pub enum Error {
TrailingDotMissing,
TrailingNulCharMissing,
InvalidLabelChar,
InvalidStructure,
TooLongDomainName,
TooLongLabel,
LabelDoesNotStartWithLetter,
EmptyLabel,
}Expand description
Error when FQDN parsing goes wrong
Variants
TrailingDotMissing
The trailing dot of the FQDN string is missing.
A valid FQDN string should be ended by a dot (e.g. github.com.).
TrailingNulCharMissing
The trailing nul byte of the FQDN bytes is missing.
A valid FQDN array of bytes should be ended by the nul byte (e.g. b"\x06github\x03com\x00")
InvalidLabelChar
An invalid character is found in a label of the FQDN.
The allowed characters in a FQDN label are letters, digits and '-'.
By default, this crate also accepts '_' in FQDN but this behavior could be deactivated with
the strict-rfc-1035 feature.
InvalidStructure
The analysed bytes are not consistent with a FQDN sequence of bytes.
Typically, the length bytes of labels are not consistent.
TooLongDomainName
The name of the domain is too long
By default, there is no limit except if the strict-rfc-1035 feature is selected and
then, the domain name should be less than 255 characters (including the trailing dot).
TooLongLabel
One label of the FQDN is too long
The returned error contains the excessive length.
By default, the limit is set to 255 characters but if the strict-rfc-1035 feature is selected,
then this limit is set to 63 (as said in the RFC).
LabelDoesNotStartWithLetter
One label does not start with a letter
The returned error contains the start position of the involved label
EmptyLabel
One label is empty (e.g. starting dot as .github.com. or two following dots as github..com.)
Trait Implementations
sourceimpl Error for Error
impl Error for Error
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl Copy for Error
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more