pub enum InterfaceCommand<M: Message> {
Connect(PeerId),
Send(PeerId, M),
Disconnect(PeerId),
}Expand description
A low-level command to interact with the network interface
Variants§
Connect(PeerId)
Initiate a connection to the given peer.
Send(PeerId, M)
Send a message to an already-connected peer.
Disconnect(PeerId)
Disconnect from the given peer.
Trait Implementations§
Source§impl<B: Behavior> From<InterfaceCommand<<B as Behavior>::Message>> for BehaviorOutput<B>
impl<B: Behavior> From<InterfaceCommand<<B as Behavior>::Message>> for BehaviorOutput<B>
Source§fn from(cmd: InterfaceCommand<B::Message>) -> Self
fn from(cmd: InterfaceCommand<B::Message>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<M> Freeze for InterfaceCommand<M>where
M: Freeze,
impl<M> RefUnwindSafe for InterfaceCommand<M>where
M: RefUnwindSafe,
impl<M> Send for InterfaceCommand<M>
impl<M> Sync for InterfaceCommand<M>where
M: Sync,
impl<M> Unpin for InterfaceCommand<M>where
M: Unpin,
impl<M> UnsafeUnpin for InterfaceCommand<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for InterfaceCommand<M>where
M: UnwindSafe,
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