pub trait Buf {
// Required methods
fn write(&mut self, bytes: &[u8]) -> bool;
fn len(&self) -> usize;
fn as_slice(&self) -> &[u8] ⓘ;
fn write_fmt(&mut self, arguments: Arguments<'_>) -> Result<(), Error>;
// Provided methods
fn write_buffer<B>(&mut self, other: B) -> bool
where B: Buf { ... }
fn push(&mut self, byte: u8) -> bool { ... }
fn is_empty(&self) -> bool { ... }
}
Expand description
A buffer allocated from a context.
Buffers are allocated through an allocator using Allocator::alloc
.
Required Methods§
Provided Methods§
sourcefn write_buffer<B>(&mut self, other: B) -> boolwhere
B: Buf,
fn write_buffer<B>(&mut self, other: B) -> boolwhere
B: Buf,
Write a buffer of the same type onto the current buffer.
This allows allocators to provide more efficient means of extending the current buffer with one provided from the same allocator.
Object Safety§
This trait is not object safe.