pub trait FragmentedBuffer {
// Required methods
fn len(&self) -> usize;
fn with_bytes<R, F>(&self, f: F) -> R
where F: for<'a, 'b> FnOnce(FragmentedBytes<'a, 'b>) -> R;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn to_flattened_vec(&self) -> Vec<u8> { ... }
}
Expand description
A buffer that may be fragmented in multiple parts which are discontiguous in memory.
Required Methods§
Sourcefn with_bytes<R, F>(&self, f: F) -> Rwhere
F: for<'a, 'b> FnOnce(FragmentedBytes<'a, 'b>) -> R,
fn with_bytes<R, F>(&self, f: F) -> Rwhere
F: for<'a, 'b> FnOnce(FragmentedBytes<'a, 'b>) -> R,
Invokes a callback on a view into this buffer’s contents as
FragmentedBytes
.
Provided Methods§
Sourcefn to_flattened_vec(&self) -> Vec<u8>
fn to_flattened_vec(&self) -> Vec<u8>
Returns a flattened version of this buffer, copying its contents into a
Vec
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.