Enum dns_protocol::Error
source · [−]#[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
NotEnoughWriteSpace
Fields
tried_to_write: NonZeroUsize
The number of entries we tried to write.
available: usize
The number of entries that were available in the buffer.
buffer_type: &'static str
The type of the buffer that we tried to write to.
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.
NotEnoughReadBytes
Fields
tried_to_read: NonZeroUsize
The number of bytes we tried to read.
available: usize
The number of bytes that were available in the buffer.
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.
Parse
Fields
name: &'static str
The name of the value we tried to 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
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()