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>
Sourcepub fn new(target: Target) -> StaticCompressor<Target>
pub fn new(target: Target) -> StaticCompressor<Target>
Creates a static compressor from an octets builder.
Sourcepub fn into_target(self) -> Target
pub fn into_target(self) -> Target
Converts the static compressor into the underlying octets builder.
Sourcepub fn as_slice_mut(&mut self) -> &mut [u8]
pub fn as_slice_mut(&mut self) -> &mut [u8]
Returns a reference to the octets slice of the content.
Trait Implementations§
Source§impl<Target> AsMut<[u8]> for StaticCompressor<Target>
impl<Target> AsMut<[u8]> for StaticCompressor<Target>
Source§impl<Target> AsRef<[u8]> for StaticCompressor<Target>
impl<Target> AsRef<[u8]> for StaticCompressor<Target>
Source§impl<Target> Clone for StaticCompressor<Target>where
Target: Clone,
impl<Target> Clone for StaticCompressor<Target>where
Target: Clone,
Source§fn clone(&self) -> StaticCompressor<Target>
fn clone(&self) -> StaticCompressor<Target>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more