pub struct ChunkBuffer { /* private fields */ }Expand description
Buffer that accumulates chunks and enforces a maximum byte capacity.
Implementations§
Source§impl ChunkBuffer
impl ChunkBuffer
Sourcepub fn new(max_capacity: usize) -> Self
pub fn new(max_capacity: usize) -> Self
Creates a new ChunkBuffer with the specified maximum capacity.
Sourcepub fn push(&mut self, chunk: &str) -> Result<(), BufferCapacityError>
pub fn push(&mut self, chunk: &str) -> Result<(), BufferCapacityError>
Pushes a string chunk into the buffer.
§Errors
Returns BufferCapacityError if pushing the chunk would exceed the maximum capacity.
Trait Implementations§
Source§impl Debug for ChunkBuffer
impl Debug for ChunkBuffer
Source§impl Default for ChunkBuffer
impl Default for ChunkBuffer
Source§fn default() -> ChunkBuffer
fn default() -> ChunkBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChunkBuffer
impl RefUnwindSafe for ChunkBuffer
impl Send for ChunkBuffer
impl Sync for ChunkBuffer
impl Unpin for ChunkBuffer
impl UnsafeUnpin for ChunkBuffer
impl UnwindSafe for ChunkBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more