pub enum DisconnectReason {
Show 13 variants
DisconnectRequested = 0,
TcpSubsystemError = 1,
ProtocolBreach = 2,
UselessPeer = 3,
TooManyPeers = 4,
AlreadyConnected = 5,
IncompatibleP2PProtocolVersion = 6,
NullNodeIdentity = 7,
ClientQuitting = 8,
UnexpectedHandshakeIdentity = 9,
ConnectedToSelf = 10,
PingTimeout = 11,
SubprotocolSpecific = 16,
}Expand description
RLPx disconnect reason.
Variants§
DisconnectRequested = 0
Disconnect requested by the local node or remote peer.
TcpSubsystemError = 1
TCP related error
ProtocolBreach = 2
Breach of protocol at the transport or p2p level
UselessPeer = 3
Node has no matching protocols.
TooManyPeers = 4
Either the remote or local node has too many peers.
AlreadyConnected = 5
Already connected to the peer.
IncompatibleP2PProtocolVersion = 6
p2p protocol version is incompatible
NullNodeIdentity = 7
Received a null node identity.
ClientQuitting = 8
Reason when the client is shutting down.
UnexpectedHandshakeIdentity = 9
When the received handshake’s identify is different from what is expected.
ConnectedToSelf = 10
The node is connected to itself
PingTimeout = 11
Peer or local node did not respond to a ping in time.
SubprotocolSpecific = 16
Peer or local node violated a subprotocol-specific rule.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for DisconnectReason
impl<'arbitrary> Arbitrary<'arbitrary> for DisconnectReason
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§impl Clone for DisconnectReason
impl Clone for DisconnectReason
impl Copy for DisconnectReason
Source§impl Debug for DisconnectReason
impl Debug for DisconnectReason
Source§impl Decodable for DisconnectReason
impl Decodable for DisconnectReason
Source§fn decode(buf: &mut &[u8]) -> Result<Self>
fn decode(buf: &mut &[u8]) -> Result<Self>
The [Decodable] implementation for DisconnectReason supports either a disconnect
reason encoded a single byte or a RLP list containing the disconnect reason.
Source§impl Default for DisconnectReason
impl Default for DisconnectReason
Source§impl<'de> Deserialize<'de> for DisconnectReason
impl<'de> Deserialize<'de> for DisconnectReason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for DisconnectReason
impl Display for DisconnectReason
Source§impl Encodable for DisconnectReason
impl Encodable for DisconnectReason
impl Eq for DisconnectReason
Source§impl PartialEq for DisconnectReason
impl PartialEq for DisconnectReason
Source§impl Serialize for DisconnectReason
impl Serialize for DisconnectReason
impl StructuralPartialEq for DisconnectReason
Auto Trait Implementations§
impl Freeze for DisconnectReason
impl RefUnwindSafe for DisconnectReason
impl Send for DisconnectReason
impl Sync for DisconnectReason
impl Unpin for DisconnectReason
impl UnsafeUnpin for DisconnectReason
impl UnwindSafe for DisconnectReason
Blanket Implementations§
impl<A> ArbInterop for A
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreimpl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
DisconnectRequested: 0 bytesTcpSubsystemError: 0 bytesProtocolBreach: 0 bytesUselessPeer: 0 bytesTooManyPeers: 0 bytesAlreadyConnected: 0 bytesIncompatibleP2PProtocolVersion: 0 bytesNullNodeIdentity: 0 bytesClientQuitting: 0 bytesUnexpectedHandshakeIdentity: 0 bytesConnectedToSelf: 0 bytesPingTimeout: 0 bytesSubprotocolSpecific: 0 bytes