pub struct WriteBuffer<const N: usize> { /* private fields */ }
Expand description
A write buffer
Implementations§
Source§impl<const N: usize> WriteBuffer<N>
impl<const N: usize> WriteBuffer<N>
Sourcepub fn as_slice(&self) -> &[u8]
pub fn as_slice(&self) -> &[u8]
Returns a slice containing the already written bytes in the buffer
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the buffer such that it can be reused.
Note: This does not overwrite any data in memory, it only sets the internal cursor back to the start of the buffer.
Sourcepub fn as_str_mut(&mut self) -> &mut str
pub fn as_str_mut(&mut self) -> &mut str
Converts the buffer into &mut str
.
Trait Implementations§
Source§impl<const N: usize> Clone for WriteBuffer<N>
impl<const N: usize> Clone for WriteBuffer<N>
Source§fn clone(&self) -> WriteBuffer<N>
fn clone(&self) -> WriteBuffer<N>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<const N: usize> Debug for WriteBuffer<N>
impl<const N: usize> Debug for WriteBuffer<N>
Source§impl<const N: usize> Default for WriteBuffer<N>
impl<const N: usize> Default for WriteBuffer<N>
Source§impl<const N: usize> Display for WriteBuffer<N>
impl<const N: usize> Display for WriteBuffer<N>
Source§impl<const N: usize> Hash for WriteBuffer<N>
impl<const N: usize> Hash for WriteBuffer<N>
Source§impl<const N: usize> PartialEq for WriteBuffer<N>
impl<const N: usize> PartialEq for WriteBuffer<N>
Source§impl<const N: usize> Write for WriteBuffer<N>
impl<const N: usize> Write for WriteBuffer<N>
impl<const N: usize> Copy for WriteBuffer<N>
impl<const N: usize> Eq for WriteBuffer<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for WriteBuffer<N>
impl<const N: usize> RefUnwindSafe for WriteBuffer<N>
impl<const N: usize> Send for WriteBuffer<N>
impl<const N: usize> Sync for WriteBuffer<N>
impl<const N: usize> Unpin for WriteBuffer<N>
impl<const N: usize> UnwindSafe for WriteBuffer<N>
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