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

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

A domain name compressor that doesn’t require an allocator.

This type wraps around an octets builder and implements domain name compression. It does not require an allocator but because of that it can only remember the position of up to 24 domain names. This should be sufficient for most messages.

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> StaticCompressor<Target>[src]

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

Creates a static compressor from an 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 static compressor into the underlying octets builder.

pub fn as_slice(&self) -> &[u8] where
    Target: AsRef<[u8]>, 
[src]

Returns a reference to the octets slice of the content.

pub fn as_slice_mut(&mut self) -> &mut [u8] where
    Target: AsMut<[u8]>, 
[src]

Returns a reference to the octets slice of the content.

Trait Implementations

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

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

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

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

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

Auto Trait Implementations

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

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

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

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

impl<Target> UnwindSafe for StaticCompressor<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<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>,