#[non_exhaustive]pub enum ProtoError {
NotEnoughWriteSpace {
tried_to_write: NonZero<usize>,
available: usize,
buffer_type: BufferType,
},
NotEnoughReadBytes {
tried_to_read: NonZero<usize>,
available: usize,
},
Parse {
name: &'static str,
},
NameTooLong(usize),
InvalidUtf8(Utf8Error),
InvalidCode(InvalidCode),
TooManyUrlSegments(usize),
}Expand description
An error that may occur while using the DNS protocol.
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.
NotEnoughWriteSpace
We are trying to write to a buffer, but the buffer doesn’t have enough space.
This error can be fixed by increasing the size of the buffer.
Fields
§
buffer_type: BufferTypeThe type of the buffer that we tried to write to.
NotEnoughReadBytes
We attempted to read from a buffer, but we ran out of room before we could read the entire value.
This error can be fixed by reading more bytes.
Fields
Parse
We tried to parse this value, but it was invalid.
NameTooLong(usize)
We tried to serialize a string longer than 256 bytes.
InvalidUtf8(Utf8Error)
We could not create a valid UTF-8 string from the bytes we read.
InvalidCode(InvalidCode)
We could not convert a raw number to a code.
TooManyUrlSegments(usize)
We do not support this many URL segments.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<S, Q> From<Error> for Error<S, Q>
impl<S, Q> From<Error> for Error<S, Q>
Source§fn from(source: ProtoError) -> Self
fn from(source: ProtoError) -> Self
Converts to this type from the input type.
Source§impl From<InvalidCode> for Error
impl From<InvalidCode> for Error
Source§fn from(err: InvalidCode) -> Error
fn from(err: InvalidCode) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
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>
Converts
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>
Converts
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