pub struct FixedBuffer<N: ArrayLength<u8>> { /* private fields */ }
Implementations§
Source§impl<N: ArrayLength<u8>> FixedBuffer<N>
impl<N: ArrayLength<u8>> FixedBuffer<N>
Trait Implementations§
Source§impl<N: ArrayLength<u8>> Clone for FixedBuffer<N>
impl<N: ArrayLength<u8>> Clone for FixedBuffer<N>
Source§impl<N: ArrayLength<u8>> Debug for FixedBuffer<N>
impl<N: ArrayLength<u8>> Debug for FixedBuffer<N>
Source§impl<N: ArrayLength<u8>> FixedBuf for FixedBuffer<N>
impl<N: ArrayLength<u8>> FixedBuf for FixedBuffer<N>
Source§fn input<F: FnMut(&[u8])>(&mut self, input: &[u8], func: F)
fn input<F: FnMut(&[u8])>(&mut self, input: &[u8], func: F)
Input a vector of bytes. If the buffer becomes full, process it with the provided
function and then clear the buffer.
Source§fn zero_until(&mut self, idx: usize)
fn zero_until(&mut self, idx: usize)
Zero the buffer up until the specified index. The buffer position currently must not be
greater than that index.
Source§fn next(&mut self, len: usize) -> &mut [u8] ⓘ
fn next(&mut self, len: usize) -> &mut [u8] ⓘ
Get a slice of the buffer of the specified size. There must be at least that many bytes
remaining in the buffer.
Source§fn full_buffer(&mut self) -> &mut [u8] ⓘ
fn full_buffer(&mut self) -> &mut [u8] ⓘ
Get the current buffer. The buffer must already be full. This clears the buffer as well.
Source§fn current_buffer(&self) -> &[u8] ⓘ
fn current_buffer(&self) -> &[u8] ⓘ
Get the current buffer.
Auto Trait Implementations§
impl<N> Freeze for FixedBuffer<N>
impl<N> RefUnwindSafe for FixedBuffer<N>
impl<N> Send for FixedBuffer<N>
impl<N> Sync for FixedBuffer<N>
impl<N> Unpin for FixedBuffer<N>
impl<N> UnwindSafe for FixedBuffer<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> StandardPadding for Twhere
T: FixedBuf,
impl<T> StandardPadding for Twhere
T: FixedBuf,
Source§fn pad<F>(&mut self, padding: u8, rem: usize, func: F)
fn pad<F>(&mut self, padding: u8, rem: usize, func: F)
Add standard padding to the buffer. The buffer must not be full when this method is called
and is guaranteed to have exactly rem remaining bytes when it returns. If there are not at
least rem bytes available, the buffer will be zero padded, processed, cleared, and then
filled with zeros again until only rem bytes are remaining.