pub struct StreamBuffer { /* private fields */ }Expand description
A reusable buffer for streaming operations.
Manages input and output buffers with efficient memory reuse.
Implementations§
Source§impl StreamBuffer
impl StreamBuffer
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new buffer with specified capacity.
Sourcepub fn write(&mut self, data: &[u8]) -> usize
pub fn write(&mut self, data: &[u8]) -> usize
Write data into the buffer.
Returns number of bytes written.
Sourcepub fn read(&mut self, buf: &mut [u8]) -> usize
pub fn read(&mut self, buf: &mut [u8]) -> usize
Read data from the buffer.
Returns number of bytes read.
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Get mutable access to the entire buffer.
Trait Implementations§
Source§impl Debug for StreamBuffer
impl Debug for StreamBuffer
Auto Trait Implementations§
impl Freeze for StreamBuffer
impl RefUnwindSafe for StreamBuffer
impl Send for StreamBuffer
impl Sync for StreamBuffer
impl Unpin for StreamBuffer
impl UnwindSafe for StreamBuffer
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