pub enum Error {
CompletelyBusted,
HeaderTooShort(u16),
QuestionTooShort(u16),
ResourceRecordTooShort(u16),
ResourceRecordInvalid(u16),
DomainTooShort(u16),
DomainTooLong(u16),
DomainPointerInvalid(u16),
DomainLabelInvalid(u16),
}
Expand description
Errors encountered when parsing a datagram. In all the errors
which have a u16
parameter, that is the ID from the header - so
that an error response can be sent.
Variants§
CompletelyBusted
The datagram is not even 2 octets long, so it doesn’t even contain a valid ID. An error cannot even be sent back to the client in this case as, without an ID, it cannot be linked with the correct query.
HeaderTooShort(u16)
The header is missing one or more required fields.
QuestionTooShort(u16)
A question ends with an incomplete field.
ResourceRecordTooShort(u16)
A resource record ends with an incomplete field.
ResourceRecordInvalid(u16)
A resource record is the wrong format.
DomainTooShort(u16)
A domain is incomplete.
DomainTooLong(u16)
A domain is over 255 octets in size.
DomainPointerInvalid(u16)
A domain pointer points to or after the current record.
DomainLabelInvalid(u16)
A domain label is longer than 63 octets, but not a pointer.
Implementations§
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()
impl Copy for Error
impl Eq for Error
impl StructuralPartialEq for Error
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