Trait domain::base::octets::OctetsExt

source ·
pub trait OctetsExt: AsRef<[u8]> {
    // Required method
    fn truncate(&mut self, len: usize);
}
Expand description

An extension trait for octet sequences.

This trait collects some additional functionality that is not available via the more general AsRef<[u8]>. Currently, that is only truncating the sequence to a given length.

Required Methods§

source

fn truncate(&mut self, len: usize)

Truncate the sequence to len octets.

If len is larger than the length of the sequence, nothing happens.

Implementations on Foreign Types§

source§

impl OctetsExt for Vec<u8>

source§

fn truncate(&mut self, len: usize)

source§

impl<'a> OctetsExt for Cow<'a, [u8]>

source§

fn truncate(&mut self, len: usize)

source§

impl OctetsExt for Bytes

source§

fn truncate(&mut self, len: usize)

source§

impl<'a> OctetsExt for &'a [u8]

source§

fn truncate(&mut self, len: usize)

source§

impl<A: Array<Item = u8>> OctetsExt for SmallVec<A>

source§

fn truncate(&mut self, len: usize)

Implementors§