pub enum InterfaceEvent<M: Message> {
Connected(PeerId),
Disconnected(PeerId),
Sent(PeerId, M),
Recv(PeerId, Vec<M>),
Error(PeerId, InterfaceError),
Idle,
}Expand description
A low-level event from the network interface
Variants§
Connected(PeerId)
A connection to the peer was successfully established.
Disconnected(PeerId)
The peer has been disconnected.
Sent(PeerId, M)
A message was successfully sent to the peer.
Recv(PeerId, Vec<M>)
One or more messages were received from the peer.
Error(PeerId, InterfaceError)
An error occurred on the connection to the peer.
Idle
No pending IO activity; useful for triggering housekeeping.
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for InterfaceEvent<M>where
M: Freeze,
impl<M> RefUnwindSafe for InterfaceEvent<M>where
M: RefUnwindSafe,
impl<M> Send for InterfaceEvent<M>
impl<M> Sync for InterfaceEvent<M>where
M: Sync,
impl<M> Unpin for InterfaceEvent<M>where
M: Unpin,
impl<M> UnsafeUnpin for InterfaceEvent<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for InterfaceEvent<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