#[non_exhaustive]pub enum ProtocolErrorKind {
InvalidMagic,
UnsupportedVersion,
MalformedFrame,
PayloadTooLarge,
UnknownMessageType,
InternalError,
}Expand description
Internal classification of protocol-level errors.
New variants will be added as error handling evolves; downstream matches should include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidMagic
The frame magic bytes do not match 0x4E455256 (“NERV”).
UnsupportedVersion
The frame version field does not match the supported version.
MalformedFrame
The frame header or payload cannot be parsed.
PayloadTooLarge
The payload_length field exceeds MAX_PAYLOAD_SIZE.
UnknownMessageType
The msg_type field does not correspond to a known MessageType.
InternalError
An implementation-level failure unrelated to wire data.
Trait Implementations§
Source§impl Clone for ProtocolErrorKind
impl Clone for ProtocolErrorKind
Source§fn clone(&self) -> ProtocolErrorKind
fn clone(&self) -> ProtocolErrorKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProtocolErrorKind
Source§impl Debug for ProtocolErrorKind
impl Debug for ProtocolErrorKind
impl Eq for ProtocolErrorKind
Source§impl Hash for ProtocolErrorKind
impl Hash for ProtocolErrorKind
Source§impl PartialEq for ProtocolErrorKind
impl PartialEq for ProtocolErrorKind
impl StructuralPartialEq for ProtocolErrorKind
Auto Trait Implementations§
impl Freeze for ProtocolErrorKind
impl RefUnwindSafe for ProtocolErrorKind
impl Send for ProtocolErrorKind
impl Sync for ProtocolErrorKind
impl Unpin for ProtocolErrorKind
impl UnsafeUnpin for ProtocolErrorKind
impl UnwindSafe for ProtocolErrorKind
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