Struct domain::base::message_builder::TreeCompressor[][src]

pub struct TreeCompressor<Target> { /* fields omitted */ }

A domain name compressor that uses a tree.

This type wraps around an octets builder and implements domain name compression for it. It stores the position of any domain name it has seen in a binary tree.

The position of a domain name is calculated relative to the beginning of the underlying octets builder. This means that this builder must represent the message only. This means that if you are using the StreamTarget, you need to place it inside this type, not the other way around.

Implementations

impl<Target> TreeCompressor<Target>[src]

pub fn new(target: Target) -> Self[src]

Creates a new compressor from an underlying octets builder.

pub fn as_target(&self) -> &Target[src]

Returns a reference to the underlying octets builder.

pub fn into_target(self) -> Target[src]

Converts the compressor into the underlying octets builder.

pub fn as_slice(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
where
    Target: AsRef<[u8]>, 
[src]

Returns an octets slice of the data.

pub fn as_slice_mut(&mut self) -> &mut [u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
where
    Target: AsMut<[u8]>, 
[src]

Returns an mutable octets slice of the data.

Trait Implementations

impl<Target: AsMut<[u8]>> AsMut<[u8]> for TreeCompressor<Target>[src]

impl<Target: AsRef<[u8]>> AsRef<[u8]> for TreeCompressor<Target>[src]

impl<Target: Clone> Clone for TreeCompressor<Target>[src]

impl<Target: Debug> Debug for TreeCompressor<Target>[src]

impl<Target: OctetsBuilder> OctetsBuilder for TreeCompressor<Target>[src]

type Octets = Target::Octets

The type of the octets the builder can be converted into. Read more

Auto Trait Implementations

impl<Target> RefUnwindSafe for TreeCompressor<Target> where
    Target: RefUnwindSafe

impl<Target> Send for TreeCompressor<Target> where
    Target: Send

impl<Target> Sync for TreeCompressor<Target> where
    Target: Sync

impl<Target> Unpin for TreeCompressor<Target> where
    Target: Unpin

impl<Target> UnwindSafe for TreeCompressor<Target> where
    Target: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Source, Target> OctetsInto<Target> for Source where
    Target: OctetsFrom<Source>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,