pub struct SimNet { /* private fields */ }Expand description
running simulation
Implementations§
Source§impl SimNet
impl SimNet
Sourcepub fn spawn_node<Fut>(
&mut self,
id: impl Into<String>,
handler: impl FnOnce(SimInterface) -> Fut + Send + 'static,
)
pub fn spawn_node<Fut>( &mut self, id: impl Into<String>, handler: impl FnOnce(SimInterface) -> Fut + Send + 'static, )
spawn a tokio task that drives your node logic
Sourcepub fn command_tx(&self) -> Sender<SimCommand>
pub fn command_tx(&self) -> Sender<SimCommand>
returns a sender for enqueuing sim commands
Auto Trait Implementations§
impl Freeze for SimNet
impl !RefUnwindSafe for SimNet
impl Send for SimNet
impl Sync for SimNet
impl Unpin for SimNet
impl !UnwindSafe for SimNet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more