Enum Event
pub enum Event {
Received {
connection_id: ConnectionId,
peer_id: PeerId,
info: Info,
},
Sent {
connection_id: ConnectionId,
peer_id: PeerId,
},
Pushed {
connection_id: ConnectionId,
peer_id: PeerId,
info: Info,
},
Error {
connection_id: ConnectionId,
peer_id: PeerId,
error: StreamUpgradeError<UpgradeError>,
},
}
Available on crate feature
identify
only.Expand description
Event emitted by the Identify
behaviour.
Variants§
Received
Identification information has been received from a peer.
Fields
§
connection_id: ConnectionId
Identifier of the connection.
Sent
Identification information of the local node has been sent to a peer in response to an identification request.
Fields
§
connection_id: ConnectionId
Identifier of the connection.
Pushed
Identification information of the local node has been actively pushed to a peer.
Fields
§
connection_id: ConnectionId
Identifier of the connection.
Error
Error while attempting to identify the remote.
Fields
§
connection_id: ConnectionId
Identifier of the connection.
§
error: StreamUpgradeError<UpgradeError>
The error that occurred.
Implementations§
§impl Event
impl Event
pub fn connection_id(&self) -> ConnectionId
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl !RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more