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>,
},
}
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.
§
peer_id: PeerId
The peer that has been identified.
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.
§
peer_id: PeerId
The peer that the information has been sent to.
Pushed
Identification information of the local node has been actively pushed to a peer.
Fields
§
connection_id: ConnectionId
Identifier of the connection.
§
peer_id: PeerId
The peer that the information has been sent to.
Error
Error while attempting to identify the remote.
Fields
§
connection_id: ConnectionId
Identifier of the connection.
§
peer_id: PeerId
The peer with whom the error originated.
§
error: StreamUpgradeError<UpgradeError>
The error that occurred.
Implementations§
Source§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§
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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