pub struct MutSliceRead<'a> { /* private fields */ }
Expand description
A CBOR input source that reads from a slice of bytes, and can move data around internally to reassemble indefinite strings without the need of an allocated scratch buffer.
Implementations§
Source§impl<'a> MutSliceRead<'a>
impl<'a> MutSliceRead<'a>
Sourcepub fn new(slice: &'a mut [u8]) -> MutSliceRead<'a>
pub fn new(slice: &'a mut [u8]) -> MutSliceRead<'a>
Creates a CBOR input source to read from a slice of bytes.
Trait Implementations§
Source§impl<'a> Debug for MutSliceRead<'a>
impl<'a> Debug for MutSliceRead<'a>
Source§impl<'a> Read<'a> for MutSliceRead<'a>
impl<'a> Read<'a> for MutSliceRead<'a>
Source§fn peek(&mut self) -> Result<Option<u8>>
fn peek(&mut self) -> Result<Option<u8>>
Peek at the next byte of the input, if any. This does not advance the reader, so the result
of this function will remain the same until a read or clear occurs.
Source§fn clear_buffer(&mut self)
fn clear_buffer(&mut self)
Clear the underlying scratch buffer
Source§fn read_to_buffer(&mut self, n: usize) -> Result<()>
fn read_to_buffer(&mut self, n: usize) -> Result<()>
Append n bytes from the reader to the reader’s scratch buffer (without clearing it)
Source§fn take_buffer<'b>(&'b mut self) -> EitherLifetime<'b, 'a>
fn take_buffer<'b>(&'b mut self) -> EitherLifetime<'b, 'a>
Read out everything accumulated in the reader’s scratch buffer. This may, as a side effect,
clear it.
Auto Trait Implementations§
impl<'a> Freeze for MutSliceRead<'a>
impl<'a> RefUnwindSafe for MutSliceRead<'a>
impl<'a> Send for MutSliceRead<'a>
impl<'a> Sync for MutSliceRead<'a>
impl<'a> Unpin for MutSliceRead<'a>
impl<'a> !UnwindSafe for MutSliceRead<'a>
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 20 bytes