Trait domain::bits::name::DName[][src]

pub trait DName: Sized {
    fn to_cow(&self) -> Cow<DNameSlice>;
fn labels(&self) -> NameLabels; fn labelettes(&self) -> NameLabelettes { ... }
fn compose<C: AsMut<Composer>>(&self, composer: C) -> ComposeResult<()> { ... }
fn compose_compressed<C: AsMut<Composer>>(
        &self,
        composer: C
    ) -> ComposeResult<()> { ... } }

A trait implemented by all domain name types.

The purpose of the trait is to allow building composite types that are generic over all possible variants of domain names. In particular, DName is implemented for &DNameSlice for references to uncompressed domain names, DNameBuf for owned uncompressed domain names, and ParsedDName for domain names parsed from DNS messages.

If you don’t need to include ParsedDName, you might want your type to be generic over AsRef<DNameSlice> instead as this allows for the full range of functionality provided by DNameSlice.

Required Methods

Converts the name into an uncompressed name.

Since unpacking parsed domain names may need allocations to collect the labels, the return value is a cow. This cow will, however, be of the borrowed variant whenever possible.

Important traits for NameLabels<'a>

Returns an iterator over the labels of the domain name.

Provided Methods

Important traits for NameLabelettes<'a>

Returns an iterator over the labelettes of the domain name.

See Labelette for a discussion of what exactly labelettes are.

Appends the name to the end of a composition.

Appends the name to the end of a composition using name compression.

Implementors