pub struct StaticCompressor<Target> { /* private fields */ }
Expand description
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§
source§impl<Target> StaticCompressor<Target>
impl<Target> StaticCompressor<Target>
Trait Implementations§
source§impl<Target: Clone> Clone for StaticCompressor<Target>
impl<Target: Clone> Clone for StaticCompressor<Target>
source§fn clone(&self) -> StaticCompressor<Target>
fn clone(&self) -> StaticCompressor<Target>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Target: Composer> Composer for StaticCompressor<Target>
impl<Target: Composer> Composer for StaticCompressor<Target>
source§fn append_compressed_name<N: ToName + ?Sized>(
&mut self,
name: &N,
) -> Result<(), Self::AppendError>
fn append_compressed_name<N: ToName + ?Sized>( &mut self, name: &N, ) -> Result<(), Self::AppendError>
Appends a domain name using name compression if supported. Read more
fn can_compress(&self) -> bool
source§impl<Target: Debug> Debug for StaticCompressor<Target>
impl<Target: Debug> Debug for StaticCompressor<Target>
source§impl<Target: FreezeBuilder> FreezeBuilder for StaticCompressor<Target>
impl<Target: FreezeBuilder> FreezeBuilder for StaticCompressor<Target>
source§impl<Target: OctetsBuilder> OctetsBuilder for StaticCompressor<Target>
impl<Target: OctetsBuilder> OctetsBuilder for StaticCompressor<Target>
source§type AppendError = <Target as OctetsBuilder>::AppendError
type AppendError = <Target as OctetsBuilder>::AppendError
The error type when appending data fails. Read more
source§fn append_slice(&mut self, slice: &[u8]) -> Result<(), Self::AppendError>
fn append_slice(&mut self, slice: &[u8]) -> Result<(), Self::AppendError>
Appends the content of a slice to the builder. Read more
Auto Trait Implementations§
impl<Target> Freeze for StaticCompressor<Target>where
Target: Freeze,
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.