Enum nakamoto_p2p::fsm::DisconnectReason
source · pub enum DisconnectReason {
PeerMisbehaving(&'static str),
PeerProtocolVersion(u32),
PeerServices(ServiceFlags),
PeerHeight(Height),
PeerMagic(u32),
PeerTimeout(&'static str),
PeerDropped,
SelfConnection,
ConnectionLimit,
DecodeError(Arc<Error>),
Command,
Other(&'static str),
}
Expand description
Disconnect reason.
Variants
PeerMisbehaving(&'static str)
Peer is misbehaving.
PeerProtocolVersion(u32)
Peer protocol version is too old or too recent.
PeerServices(ServiceFlags)
Peer doesn’t have the required services.
PeerHeight(Height)
Peer chain is too far behind.
PeerMagic(u32)
Peer magic is invalid.
PeerTimeout(&'static str)
Peer timed out.
PeerDropped
Peer was dropped by all sub-protocols.
SelfConnection
Connection to self was detected.
ConnectionLimit
Inbound connection limit reached.
DecodeError(Arc<Error>)
Error trying to decode incoming message.
Command
Peer was forced to disconnect by external command.
Other(&'static str)
Peer was disconnected for another reason.
Implementations
sourceimpl DisconnectReason
impl DisconnectReason
sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Check whether the disconnect reason is transient, ie. may no longer be applicable after some time.
Trait Implementations
sourceimpl Clone for DisconnectReason
impl Clone for DisconnectReason
sourcefn clone(&self) -> DisconnectReason
fn clone(&self) -> DisconnectReason
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for DisconnectReason
impl Debug for DisconnectReason
sourceimpl Display for DisconnectReason
impl Display for DisconnectReason
sourceimpl From<DisconnectReason> for Disconnect<DisconnectReason>
impl From<DisconnectReason> for Disconnect<DisconnectReason>
sourcefn from(reason: DisconnectReason) -> Self
fn from(reason: DisconnectReason) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for DisconnectReason
impl Send for DisconnectReason
impl Sync for DisconnectReason
impl Unpin for DisconnectReason
impl !UnwindSafe for DisconnectReason
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more