Event

Enum Event 

Source
#[non_exhaustive]
pub enum Event { AddressBanned { address: Multiaddr, }, AddressUnbanned { address: Multiaddr, }, AddressBound { address: Multiaddr, }, CommandFailed { command: Command, reason: Error, }, LocalIdCreated { local_id: PeerId, }, PeerAdded { peer_id: PeerId, info: PeerInfo, }, PeerBanned { peer_id: PeerId, }, PeerConnected { peer_id: PeerId, info: PeerInfo, gossip_in: GossipReceiver, gossip_out: GossipSender, }, PeerDisconnected { peer_id: PeerId, }, PeerRemoved { peer_id: PeerId, }, PeerUnbanned { peer_id: PeerId, }, }
Expand description

Describes the public events produced by the networking layer.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AddressBanned

An address was banned.

Fields

§address: Multiaddr

The peer’s address.

§

AddressUnbanned

An address was unbanned.

Fields

§address: Multiaddr

The peer’s address.

§

AddressBound

An address was bound.

Fields

§address: Multiaddr

The assigned bind address.

§

CommandFailed

A command failed.

Fields

§command: Command

The command that failed.

§reason: Error

The reason for the failure.

§

LocalIdCreated

The local peer id was created.

Fields

§local_id: PeerId

The created peer id from the Ed25519 keypair.

§

PeerAdded

A peer was added.

Fields

§peer_id: PeerId

The peer’s id.

§info: PeerInfo

The peer’s info.

§

PeerBanned

A peer was banned.

Fields

§peer_id: PeerId

The peer’s id.

§

PeerConnected

A peer was connected.

Fields

§peer_id: PeerId

The peer’s id.

§info: PeerInfo

The peer’s info.

§gossip_in: GossipReceiver

The peer’s message recv channel.

§gossip_out: GossipSender

The peer’s message send channel.

§

PeerDisconnected

A peer was disconnected.

Fields

§peer_id: PeerId

The peer’s id.

§

PeerRemoved

A peer was removed.

Fields

§peer_id: PeerId

The peer’s id.

§

PeerUnbanned

A peer was unbanned.

Fields

§peer_id: PeerId

The peer’s id.

Trait Implementations§

Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,