Enum litep2p::protocol::notification::NotificationEvent
source · pub enum NotificationEvent {
ValidateSubstream {
protocol: ProtocolName,
fallback: Option<ProtocolName>,
peer: PeerId,
handshake: Vec<u8>,
},
NotificationStreamOpened {
protocol: ProtocolName,
fallback: Option<ProtocolName>,
direction: Direction,
peer: PeerId,
handshake: Vec<u8>,
},
NotificationStreamClosed {
peer: PeerId,
},
NotificationStreamOpenFailure {
peer: PeerId,
error: NotificationError,
},
NotificationReceived {
peer: PeerId,
notification: BytesMut,
},
}
Expand description
Notification events.
Variants§
ValidateSubstream
Validate substream.
Fields
§
protocol: ProtocolName
Protocol name.
§
fallback: Option<ProtocolName>
Fallback, if the substream was negotiated using a fallback protocol.
NotificationStreamOpened
Notification stream opened.
Fields
§
protocol: ProtocolName
Protocol name.
§
fallback: Option<ProtocolName>
Fallback, if the substream was negotiated using a fallback protocol.
§
direction: Direction
Direction of the substream.
Direction::Inbound
indicates that the
substream was opened by the remote peer and
Direction::Outbound
that it was
opened by the local node.
NotificationStreamClosed
Notification stream closed.
NotificationStreamOpenFailure
Failed to open notification stream.
NotificationReceived
Notification received.
Trait Implementations§
source§impl Clone for NotificationEvent
impl Clone for NotificationEvent
source§fn clone(&self) -> NotificationEvent
fn clone(&self) -> NotificationEvent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for NotificationEvent
impl Debug for NotificationEvent
source§impl PartialEq for NotificationEvent
impl PartialEq for NotificationEvent
source§fn eq(&self, other: &NotificationEvent) -> bool
fn eq(&self, other: &NotificationEvent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for NotificationEvent
impl StructuralPartialEq for NotificationEvent
Auto Trait Implementations§
impl Freeze for NotificationEvent
impl RefUnwindSafe for NotificationEvent
impl Send for NotificationEvent
impl Sync for NotificationEvent
impl Unpin for NotificationEvent
impl UnwindSafe for NotificationEvent
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.