#[non_exhaustive]pub enum ProtoError {
#[non_exhaustive] CharacterDataTooLong {
max: usize,
len: usize,
},
Decode(DecodeError),
FormError {
header: Metadata,
error: Box<Self>,
},
MaxBufferSizeExceeded(usize),
Message(&'static str),
Msg(String),
#[non_exhaustive] NotAllRecordsWritten {
count: usize,
},
NotAResponse,
UrlParsing(ParseError),
Utf8(Utf8Error),
FromUtf8(FromUtf8Error),
ParseInt(ParseIntError),
}Expand description
The error kind for errors that get returned in the crate
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.
#[non_exhaustive]CharacterDataTooLong
Character data length exceeded the limit
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Decode(DecodeError)
Message decoding error
FormError
Format error in Message Parsing
Fields
MaxBufferSizeExceeded(usize)
The maximum buffer size was exceeded
Message(&'static str)
An error with an arbitrary message, referenced as &’static str
Msg(String)
An error with an arbitrary message, stored as String
#[non_exhaustive]NotAllRecordsWritten
Not all records were able to be written
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
NotAResponse
A response was received with QR=0, indicating it was a query and not a response
UrlParsing(ParseError)
An url parsing error
Utf8(Utf8Error)
A utf8 parsing error
FromUtf8(FromUtf8Error)
A utf8 parsing error
ParseInt(ParseIntError)
An int parsing error
Trait Implementations§
Source§impl Clone for ProtoError
impl Clone for ProtoError
Source§fn clone(&self) -> ProtoError
fn clone(&self) -> ProtoError
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 moreSource§impl Debug for ProtoError
impl Debug for ProtoError
Source§impl Display for ProtoError
impl Display for ProtoError
Source§impl Error for ProtoError
impl Error for ProtoError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<&'static str> for ProtoError
impl From<&'static str> for ProtoError
Source§impl From<DecodeError> for ProtoError
impl From<DecodeError> for ProtoError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<FromUtf8Error> for ProtoError
impl From<FromUtf8Error> for ProtoError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for ProtoError
impl From<ParseError> for ProtoError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for ProtoError
impl From<ParseIntError> for ProtoError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl From<ProtoError> for ParseError
impl From<ProtoError> for ParseError
Source§fn from(source: ProtoError) -> Self
fn from(source: ProtoError) -> Self
Converts to this type from the input type.
Source§impl From<String> for ProtoError
impl From<String> for ProtoError
Auto Trait Implementations§
impl Freeze for ProtoError
impl RefUnwindSafe for ProtoError
impl Send for ProtoError
impl Sync for ProtoError
impl Unpin for ProtoError
impl UnsafeUnpin for ProtoError
impl UnwindSafe for ProtoError
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