#[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
§
relation: PeerRelationThe relation with that peer.
RemovePeer
Removes a peer.
DialPeer
Dials a peer.
DialAddress
Dials an address.
DisconnectPeer
Disconnects a peer.
BanPeer
Bans a peer.
UnbanPeer
Unbans a peer.
BanAddress
Bans an address.
UnbanAddress
Unbans an address.
ChangeRelation
Upgrades the relation with a peer.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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> 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