#[non_exhaustive]pub enum Error {
NotEnoughWriteSpace {
tried_to_write: NonZeroUsize,
available: usize,
buffer_type: &'static str,
},
NotEnoughReadBytes {
tried_to_read: NonZeroUsize,
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
§
tried_to_write: NonZeroUsize
The number of entries we tried to write.
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
§
tried_to_read: NonZeroUsize
The number of bytes we tried to read.
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 StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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<InvalidCode> for Error
impl From<InvalidCode> for Error
Source§fn from(err: InvalidCode) -> Self
fn from(err: InvalidCode) -> Self
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