Enum sc_network::event::Event
source · pub enum Event {
Dht(DhtEvent),
NotificationStreamOpened {
remote: PeerId,
protocol: ProtocolName,
negotiated_fallback: Option<ProtocolName>,
role: ObservedRole,
received_handshake: Vec<u8>,
},
NotificationStreamClosed {
remote: PeerId,
protocol: ProtocolName,
},
NotificationsReceived {
remote: PeerId,
messages: Vec<(ProtocolName, Bytes)>,
},
}
Expand description
Type for events generated by networking layer.
Variants§
Dht(DhtEvent)
Event generated by a DHT.
NotificationStreamOpened
Fields
protocol: ProtocolName
The concerned protocol. Each protocol uses a different substream.
This is always equal to the value of
sc_network::config::NonDefaultSetConfig::notifications_protocol
of one of the
configured sets.
negotiated_fallback: Option<ProtocolName>
If the negotiation didn’t use the main name of the protocol (the one in
notifications_protocol
), then this field contains which name has actually been
used.
Always contains a value equal to the value in
sc_network::config::NonDefaultSetConfig::fallback_names
.
role: ObservedRole
Role of the remote.
Opened a substream with the given node with the given notifications protocol.
The protocol is always one of the notification protocols that have been registered.
NotificationStreamClosed
Fields
protocol: ProtocolName
The concerned protocol. Each protocol uses a different substream.
Closed a substream with the given node. Always matches a corresponding previous
NotificationStreamOpened
message.
NotificationsReceived
Fields
messages: Vec<(ProtocolName, Bytes)>
Concerned protocol and associated message.
Received one or more messages from the given node using the given protocol.
Trait Implementations§
Auto Trait Implementations§
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> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.