pub struct CBORDecoder<'a> { /* private fields */ }Implementations§
Source§impl<'a> CBORDecoder<'a>
impl<'a> CBORDecoder<'a>
pub fn new(bytes: &'a [u8]) -> Self
Sourcepub fn read_slice(&mut self, n: usize) -> Result<&'a [u8], CBORError>
pub fn read_slice(&mut self, n: usize) -> Result<&'a [u8], CBORError>
Consume and return n bytes starting at the current position.
pub fn position(&self) -> usize
pub fn finished(&self) -> bool
pub fn ensure_finished(&self) -> Result<(), CBORError>
pub fn remaining_buffer(&self) -> Result<&[u8], CBORError>
Sourcepub fn bytes_sized(
&mut self,
expected_size: usize,
) -> Result<&'a [u8], CBORError>
pub fn bytes_sized( &mut self, expected_size: usize, ) -> Result<&'a [u8], CBORError>
Decode a byte slice of an expected size.
Sourcepub fn any_as_encoded(&mut self) -> Result<&'a [u8], CBORError>
pub fn any_as_encoded(&mut self) -> Result<&'a [u8], CBORError>
Decode any (supported) CBOR item, but ignore its internal structure and just return the encoded data.
To have bound memory requirements, this depends on the encoded data to be in deterministic encoding, thus not having any indeterminate length items.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CBORDecoder<'a>
impl<'a> RefUnwindSafe for CBORDecoder<'a>
impl<'a> Send for CBORDecoder<'a>
impl<'a> Sync for CBORDecoder<'a>
impl<'a> Unpin for CBORDecoder<'a>
impl<'a> UnwindSafe for CBORDecoder<'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