Enum DisconnectReason
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§
§impl<'arbitrary> Arbitrary<'arbitrary> for DisconnectReason
impl<'arbitrary> Arbitrary<'arbitrary> for DisconnectReason
§fn arbitrary(
u: &mut Unstructured<'arbitrary>,
) -> Result<DisconnectReason, Error>
fn arbitrary( u: &mut Unstructured<'arbitrary>, ) -> Result<DisconnectReason, Error>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<DisconnectReason, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<DisconnectReason, Error>
Self from the entirety of the given
unstructured data. Read more§impl Clone for DisconnectReason
impl Clone for DisconnectReason
§fn clone(&self) -> DisconnectReason
fn clone(&self) -> DisconnectReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DisconnectReason
§impl Debug for DisconnectReason
impl Debug for DisconnectReason
§impl Decodable for DisconnectReason
impl Decodable for DisconnectReason
§fn decode(buf: &mut &[u8]) -> Result<DisconnectReason, Error>
fn decode(buf: &mut &[u8]) -> Result<DisconnectReason, Error>
The [Decodable] implementation for DisconnectReason supports either a disconnect
reason encoded a single byte or a RLP list containing the disconnect reason.
§impl Default for DisconnectReason
impl Default for DisconnectReason
§fn default() -> DisconnectReason
fn default() -> DisconnectReason
§impl<'de> Deserialize<'de> for DisconnectReason
impl<'de> Deserialize<'de> for DisconnectReason
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DisconnectReason, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DisconnectReason, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for DisconnectReason
impl Display for DisconnectReason
§impl Encodable for DisconnectReason
impl Encodable for DisconnectReason
impl Eq for DisconnectReason
§impl PartialEq for DisconnectReason
impl PartialEq for DisconnectReason
§impl Serialize for DisconnectReason
impl Serialize for DisconnectReason
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for DisconnectReason
§impl TryFrom<u8> for DisconnectReason
impl TryFrom<u8> for DisconnectReason
§type Error = UnknownDisconnectReason
type Error = UnknownDisconnectReason
§fn try_from(
value: u8,
) -> Result<DisconnectReason, <DisconnectReason as TryFrom<u8>>::Error>
fn try_from( value: u8, ) -> Result<DisconnectReason, <DisconnectReason as TryFrom<u8>>::Error>
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