pub enum PeerRelation {
Known,
Unknown,
}Expand description
Describes the relation with a peer.
Variants§
Known
Represents a persistent peer. If the connection to such a peer drops, the network will try to reconnect.
Unknown
Represents an ephemeral peer. If the connection to such a peer drops, the network won’t try to reconnect.
Implementations§
Source§impl PeerRelation
impl PeerRelation
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns whether the peer is unknown.
Sourcepub fn set_unknown(&mut self)
pub fn set_unknown(&mut self)
Sets the relation to PeerRelation::Unknown.
Trait Implementations§
Source§impl Clone for PeerRelation
impl Clone for PeerRelation
Source§fn clone(&self) -> PeerRelation
fn clone(&self) -> PeerRelation
Returns a duplicate 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 PeerRelation
impl Debug for PeerRelation
Source§impl PartialEq for PeerRelation
impl PartialEq for PeerRelation
impl Copy for PeerRelation
impl Eq for PeerRelation
impl StructuralPartialEq for PeerRelation
Auto Trait Implementations§
impl Freeze for PeerRelation
impl RefUnwindSafe for PeerRelation
impl Send for PeerRelation
impl Sync for PeerRelation
impl Unpin for PeerRelation
impl UnwindSafe for PeerRelation
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§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