Enum libp2p_core::nodes::collection::CollectionEvent
source · pub enum CollectionEvent<'a, TInEvent: 'a, TOutEvent: 'a, THandler: 'a, TReachErr, THandlerErr> {
NodeReached(CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>),
NodeClosed {
peer_id: PeerId,
},
NodeError {
peer_id: PeerId,
error: HandledNodeError<THandlerErr>,
},
ReachError {
id: ReachAttemptId,
error: TReachErr,
handler: THandler,
},
NodeEvent {
peer_id: PeerId,
event: TOutEvent,
},
}Expand description
Event that can happen on the CollectionStream.
Variants
NodeReached(CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>)
A connection to a node has succeeded. You must use the provided event in order to accept the connection.
NodeClosed
Fields
peer_id: PeerIdIdentifier of the node.
A connection to a node has been closed.
This happens once both the inbound and outbound channels are closed, and no more outbound substream attempt is pending.
NodeError
Fields
peer_id: PeerIdIdentifier of the node.
error: HandledNodeError<THandlerErr>The error that happened.
A connection to a node has errored.
Can only happen after a node has been successfully reached.
ReachError
Fields
id: ReachAttemptIdIdentifier of the reach attempt that failed.
An error happened on the future that was trying to reach a node.
NodeEvent
A node has produced an event.
Trait Implementations
Auto Trait Implementations
impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> !RefUnwindSafe for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>
impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> Send for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>where
THandler: Send,
THandlerErr: Send,
TInEvent: Send,
TOutEvent: Send,
TReachErr: Send,
impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> !Sync for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>
impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> Unpin for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>where
THandler: Unpin,
THandlerErr: Unpin,
TOutEvent: Unpin,
TReachErr: Unpin,
impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> !UnwindSafe for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more