Trait zenoh_protocol::io::SplitBuffer
source · pub trait SplitBuffer<'a> {
type Slices: Iterator<Item = &'a [u8]> + ExactSizeIterator;
fn slices(&'a self) -> Self::Slices;
fn is_empty(&'a self) -> bool { ... }
fn len(&'a self) -> usize { ... }
fn contiguous(&'a self) -> Cow<'a, [u8]> { ... }
}Expand description
A trait for buffers that can be composed of multiple non contiguous slices.
Required Associated Types§
type Slices: Iterator<Item = &'a [u8]> + ExactSizeIterator
Required Methods§
Provided Methods§
sourcefn contiguous(&'a self) -> Cow<'a, [u8]>
fn contiguous(&'a self) -> Cow<'a, [u8]>
Returns all the bytes of this buffer in a conitguous slice. This may require allocation and copy if the original buffer is not contiguous.