pub enum P2PStreamError {
Show 20 variants
Io(Error),
Rlp(Error),
Snap(Error),
HandshakeError(P2PHandshakeError),
MessageTooBig {
message_size: usize,
max_size: usize,
},
SubprotocolMessageTooBig {
capability: Capability,
message_size: usize,
max_size: usize,
},
SubprotocolInboundBufferFull {
capability: Capability,
},
UnknownSubprotocolMessageId(u8),
UnknownReservedMessageId(u8),
EmptyProtocolMessage,
InvalidPingPongPayload(u8),
TooManyPings,
PingerError(PingerError),
PingTimeout,
ParseSharedCapability(SharedCapabilityError),
CapabilityNotShared,
MismatchedProtocolVersion(GotExpected<ProtocolVersion>),
SendBufferFull,
Disconnected(DisconnectReason),
UnknownDisconnectReason(UnknownDisconnectReason),
}Expand description
Errors when sending/receiving p2p messages. These should result in kicking the peer.
Variants§
Io(Error)
I/O error.
Rlp(Error)
RLP encoding/decoding error.
Snap(Error)
Error in compression/decompression using Snappy.
HandshakeError(P2PHandshakeError)
Error during the P2P handshake.
MessageTooBig
Message size exceeds maximum length error.
Fields
SubprotocolMessageTooBig
A subprotocol message exceeds the limit declared by its local handler.
Fields
capability: CapabilityThe negotiated capability whose limit was exceeded.
SubprotocolInboundBufferFull
A subprotocol’s bounded inbound queue has no remaining capacity.
Fields
capability: CapabilityThe negotiated capability whose queue is full.
UnknownSubprotocolMessageId(u8)
An incoming message ID is outside all negotiated subprotocol ranges.
UnknownReservedMessageId(u8)
Unknown reserved P2P message ID error.
EmptyProtocolMessage
Empty protocol message received error.
InvalidPingPongPayload(u8)
Ping or Pong payload is not an RLP empty list.
TooManyPings
Incoming ping rate limit exceeded.
PingerError(PingerError)
Error related to the Pinger.
PingTimeout
Ping timeout error.
Error parsing shared capabilities.
Capability not supported on the stream to this peer.
MismatchedProtocolVersion(GotExpected<ProtocolVersion>)
Mismatched protocol version error.
SendBufferFull
Too many messages buffered before sending.
Disconnected(DisconnectReason)
Disconnected error.
UnknownDisconnectReason(UnknownDisconnectReason)
Unknown disconnect reason error.
Implementations§
Source§impl P2PStreamError
impl P2PStreamError
Sourcepub const fn as_disconnected(&self) -> Option<DisconnectReason>
pub const fn as_disconnected(&self) -> Option<DisconnectReason>
Returns the DisconnectReason if it is the Disconnected variant.
Trait Implementations§
Source§impl Debug for P2PStreamError
impl Debug for P2PStreamError
Source§impl Display for P2PStreamError
impl Display for P2PStreamError
Source§impl Error for P2PStreamError
impl Error for P2PStreamError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for P2PStreamError
impl From<Error> for P2PStreamError
Source§impl From<Error> for P2PStreamError
impl From<Error> for P2PStreamError
Source§impl From<Error> for P2PStreamError
impl From<Error> for P2PStreamError
Source§impl From<P2PHandshakeError> for P2PStreamError
impl From<P2PHandshakeError> for P2PStreamError
Source§fn from(source: P2PHandshakeError) -> Self
fn from(source: P2PHandshakeError) -> Self
Source§impl From<P2PStreamError> for EthStreamError
impl From<P2PStreamError> for EthStreamError
Source§fn from(source: P2PStreamError) -> Self
fn from(source: P2PStreamError) -> Self
Source§impl From<PingerError> for P2PStreamError
impl From<PingerError> for P2PStreamError
Source§fn from(source: PingerError) -> Self
fn from(source: PingerError) -> Self
Source§fn from(source: SharedCapabilityError) -> Self
fn from(source: SharedCapabilityError) -> Self
Source§impl From<UnknownDisconnectReason> for P2PStreamError
impl From<UnknownDisconnectReason> for P2PStreamError
Source§fn from(source: UnknownDisconnectReason) -> Self
fn from(source: UnknownDisconnectReason) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for P2PStreamError
impl !UnwindSafe for P2PStreamError
impl Freeze for P2PStreamError
impl Send for P2PStreamError
impl Sync for P2PStreamError
impl Unpin for P2PStreamError
impl UnsafeUnpin for P2PStreamError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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 more§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: 48 bytes
Size for each variant:
Io: 16 bytesRlp: 32 bytesSnap: 40 bytesHandshakeError: 32 bytesMessageTooBig: 24 bytesSubprotocolMessageTooBig: 48 bytesSubprotocolInboundBufferFull: 40 bytesUnknownSubprotocolMessageId: 9 bytesUnknownReservedMessageId: 9 bytesEmptyProtocolMessage: 0 bytesInvalidPingPongPayload: 9 bytesTooManyPings: 0 bytesPingerError: 0 bytesPingTimeout: 0 bytesParseSharedCapability: 32 bytesCapabilityNotShared: 0 bytesMismatchedProtocolVersion: 10 bytesSendBufferFull: 0 bytesDisconnected: 9 bytesUnknownDisconnectReason: 9 bytes