pub struct Buffer<B> {
inner: B,
len: usize,
cap: usize,
}
Fields§
§inner: B
§len: usize
§cap: usize
Implementations§
Source§impl<B> Buffer<B>
impl<B> Buffer<B>
Sourcepub fn resize(&mut self, new_size: usize)
pub fn resize(&mut self, new_size: usize)
Resizes the buffer in-place so that len
is equal to new_size
.
Sourcepub fn extend_from_slice(&mut self, bytes: &[u8])
pub fn extend_from_slice(&mut self, bytes: &[u8])
Appends all elements in a slice to the buffer.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Buffer<B>where
B: Freeze,
impl<B> RefUnwindSafe for Buffer<B>where
B: RefUnwindSafe,
impl<B> Send for Buffer<B>where
B: Send,
impl<B> Sync for Buffer<B>where
B: Sync,
impl<B> Unpin for Buffer<B>where
B: Unpin,
impl<B> UnwindSafe for Buffer<B>where
B: UnwindSafe,
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