Struct dns_message_parser::DomainName [−][src]
pub struct DomainName(_);Implementations
Append a label to the domain name.
If the label cannot be appended then the domain name is not changed. The label cannot be appended if the label is too big or the label contains a dot character or the domain name would be too big.
Example
let mut domain_name = DomainName::default();
// Prints "."
println!("{}", domain_name);
domain_name.append_label("example").unwrap();
// Prints "example."
println!("{}", domain_name);
domain_name.append_label("org").unwrap();
// Prints "example.org."
println!("{}", domain_name);
let result = domain_name.append_label(".");
// Prints "true"
println!("{}", result.is_err());
// Prints "example.org."
println!("{}", domain_name);Trait Implementations
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
type Error = DomainNameError
type Error = DomainNameError
The type returned in the event of a conversion error.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for DomainName
impl Send for DomainName
impl Sync for DomainName
impl Unpin for DomainName
impl UnwindSafe for DomainName
Blanket Implementations
Mutably borrows from an owned value. Read more