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: ConnectionIdIdentifier 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: ConnectionIdIdentifier of the connection.
Pushed
Identification information of the local node has been actively pushed to a peer.
Fields
§
connection_id: ConnectionIdIdentifier of the connection.
Error
Error while attempting to identify the remote.
Fields
§
connection_id: ConnectionIdIdentifier 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 !UnwindSafe for Event
impl Forget for Event
impl Move for Event
impl Send for Event
impl Sync for Event
impl Unpin for Eventwhere
*const u8 is !null: Unpin,
AffinePoint: Unpin,
AffinePoint<NistP256>: Unpin,
*const u8: Unpin,
Align8<*mut ()>: Unpin,
&'static Vtable: Unpin,
&'static str: Unpin,
Arc<str>: Unpin,
*const () is !null: Unpin,
&'static SimpleMessage: Unpin,
*const Custom is !null: Unpin,
Box<dyn Error + Sync + Send>: Unpin,
impl UnsafeUnpin for Eventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
AffinePoint: UnsafeUnpin,
AffinePoint<NistP256>: UnsafeUnpin,
PhantomData<Multiaddr>: UnsafeUnpin,
PhantomData<StreamProtocol>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
*const () is !null: UnsafeUnpin,
PhantomData<ErrorData<CustomOwner>>: UnsafeUnpin,
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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