baliuzeger / try_signalling

0 stars 0 forks source link

loosen the type restriction on Connections in Vec of agent_components #5

Closed baliuzeger closed 5 years ago

baliuzeger commented 5 years ago

pub struct ComponentIdle<C, S0, S1> where C: PassiveConnection<S0, S1> + Send + ?Sized, { connections: Vec<Weak<Mutex<C>>>, }

to

Inlet<S0> & Outlet<S1> respectively for post/pre components.

baliuzeger commented 5 years ago

`pub trait PassiveConnection<S0: Send, S1: Send> { fn mode(&self) -> RunMode; fn config_run(&mut self, mode: RunMode); fn config_idle(&mut self); fn propagate(&self); // fn set_pre_channel_ffw(&mut self, channel: Option<CCReceiver>); // fn set_post_channel_ffw(&mut self, channel: Option<CCSender>); fn run(&self, rx_confirm: CCReceiver, tx_report: CCSender); }

pub trait PassiveImporter: PassiveConnection<S0: Send, S1: Send> { fn set_pre_channel_ffw(&mut self, channel: Option<CCReceiver>); }

pub trait PassiveExporter: PassiveConnection<S0: Send, S1: Send> { fn set_post_channel_ffw(&mut self, channel: Option<CCSender>); } `

baliuzeger commented 5 years ago

done.