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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()