Struct domain::base::message_builder::TreeCompressor [−][src]
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]ⓘ where
Target: AsRef<[u8]>,
[src]
Target: AsRef<[u8]>,
Returns an octets slice of the data.
pub fn as_slice_mut(&mut self) -> &mut [u8]ⓘ where
Target: AsMut<[u8]>,
[src]
Target: AsMut<[u8]>,
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]
fn clone(&self) -> TreeCompressor<Target>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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
fn append_slice(&mut self, slice: &[u8]) -> Result<(), ShortBuf>
[src]
fn truncate(&mut self, len: usize)
[src]
fn append_compressed_dname<N: ToDname>(
&mut self,
name: &N
) -> Result<(), ShortBuf>
[src]
&mut self,
name: &N
) -> Result<(), ShortBuf>
fn freeze(self) -> Self::Octets
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
fn append_all<F>(&mut self, op: F) -> Result<(), ShortBuf> where
F: FnOnce(&mut Self) -> Result<(), ShortBuf>,
[src]
F: FnOnce(&mut Self) -> Result<(), ShortBuf>,
fn u16_len_prefixed<F>(&mut self, op: F) -> Result<(), ShortBuf> where
F: FnOnce(&mut Self) -> Result<(), ShortBuf>,
[src]
F: FnOnce(&mut Self) -> Result<(), ShortBuf>,
Auto Trait Implementations
impl<Target> RefUnwindSafe for TreeCompressor<Target> where
Target: RefUnwindSafe,
Target: RefUnwindSafe,
impl<Target> Send for TreeCompressor<Target> where
Target: Send,
Target: Send,
impl<Target> Sync for TreeCompressor<Target> where
Target: Sync,
Target: Sync,
impl<Target> Unpin for TreeCompressor<Target> where
Target: Unpin,
Target: Unpin,
impl<Target> UnwindSafe for TreeCompressor<Target> where
Target: UnwindSafe,
Target: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Source, Target> OctetsInto<Target> for Source where
Target: OctetsFrom<Source>,
[src]
Target: OctetsFrom<Source>,
pub fn octets_into(Self) -> Result<Target, ShortBuf>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,