pub enum Event<M: Message> {
ConnectedTo {
target: Target,
result: Result<PeerId>,
},
ConnectedFrom {
peer: PeerId,
addr: SocketAddr,
interface: SocketAddr,
},
Disconnected {
peer: PeerId,
reason: DisconnectReason,
},
Message {
peer: PeerId,
message: M,
size: usize,
},
NoPeer(PeerId),
SendBufferFull {
peer: PeerId,
message: M,
},
}Variants§
ConnectedTo
The reactor attempted to connect to a remote peer.
Fields
ConnectedFrom
The reactor received a connection from a remote peer.
Fields
§
addr: SocketAddrThe address of the remote peer.
§
interface: SocketAddrThe address of the local interface that accepted the connection.
Disconnected
A peer disconnected.
Fields
§
reason: DisconnectReasonThe reason the peer left.
Message
A peer produced a message.
Fields
§
message: MThe message received from the peer.
NoPeer(PeerId)
No peer exists with the specified id. Sent when an operation was specified using a peer id that is not present in the reactor.
SendBufferFull
The send buffer associated with the peer is full. It means the peer is probably not reading data from the wire in a timely manner.
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for Event<M>where
M: Freeze,
impl<M> !RefUnwindSafe for Event<M>
impl<M> Send for Event<M>
impl<M> Sync for Event<M>
impl<M> Unpin for Event<M>where
M: Unpin,
impl<M> !UnwindSafe for Event<M>
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