[−][src]Struct domain::base::message_builder::StaticCompressor
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]
Target: AsRef<[u8]>,
Returns a reference to the octets slice of the content.
pub fn as_slice_mut(&mut self) -> &mut [u8] where
Target: AsMut<[u8]>,
[src]
Target: AsMut<[u8]>,
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]
fn clone(&self) -> StaticCompressor<Target>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Target: Debug> Debug for StaticCompressor<Target>
[src]
impl<Target: OctetsBuilder> OctetsBuilder for StaticCompressor<Target>
[src]
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 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 StaticCompressor<Target> where
Target: RefUnwindSafe,
Target: RefUnwindSafe,
impl<Target> Send for StaticCompressor<Target> where
Target: Send,
Target: Send,
impl<Target> Sync for StaticCompressor<Target> where
Target: Sync,
Target: Sync,
impl<Target> Unpin for StaticCompressor<Target> where
Target: Unpin,
Target: Unpin,
impl<Target> UnwindSafe for StaticCompressor<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,
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<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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.
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>,