Skip to main content

Command

Enum Command 

Source
#[non_exhaustive]
pub enum Command { AddPeer { peer_id: PeerId, multiaddr: Multiaddr, alias: Option<String>, relation: PeerRelation, }, RemovePeer { peer_id: PeerId, }, DialPeer { peer_id: PeerId, }, DialAddress { address: Multiaddr, }, DisconnectPeer { peer_id: PeerId, }, BanPeer { peer_id: PeerId, }, UnbanPeer { peer_id: PeerId, }, BanAddress { address: Multiaddr, }, UnbanAddress { address: Multiaddr, }, ChangeRelation { peer_id: PeerId, to: PeerRelation, }, }
Expand description

Describes the commands accepted 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.
§

AddPeer

Adds a peer.

Fields

§peer_id: PeerId

The peer’s id.

§multiaddr: Multiaddr

The peer’s address.

§alias: Option<String>

The peer’s optional alias.

§relation: PeerRelation

The relation with that peer.

§

RemovePeer

Removes a peer.

Fields

§peer_id: PeerId

The peer’s id.

§

DialPeer

Dials a peer.

Fields

§peer_id: PeerId

The peer’s id.

§

DialAddress

Dials an address.

Fields

§address: Multiaddr

The peer’s address.

§

DisconnectPeer

Disconnects a peer.

Fields

§peer_id: PeerId

The peer’s id.

§

BanPeer

Bans a peer.

Fields

§peer_id: PeerId

The peer’s id.

§

UnbanPeer

Unbans a peer.

Fields

§peer_id: PeerId

The peer’s id.

§

BanAddress

Bans an address.

Fields

§address: Multiaddr

The peer’s address.

§

UnbanAddress

Unbans an address.

Fields

§address: Multiaddr

The peer’s address.

§

ChangeRelation

Upgrades the relation with a peer.

Fields

§peer_id: PeerId

The peer’s id.

§to: PeerRelation

The peer’s new relation.

Trait Implementations§

Source§

impl Debug for Command

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Command

Source§

impl PartialEq for Command

Source§

fn eq(&self, other: &Command) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Command

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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