pub struct MapDecoder<'a, 'de, const CHECKED: bool> { /* private fields */ }Expand description
Map decoder guard that manages depth, length, and key ordering.
Implementations§
Source§impl<'de, const CHECKED: bool> MapDecoder<'_, 'de, CHECKED>
impl<'de, const CHECKED: bool> MapDecoder<'_, 'de, CHECKED>
Sourcepub fn next_key(&mut self) -> Result<Option<&'de str>, CborError>
pub fn next_key(&mut self) -> Result<Option<&'de str>, CborError>
Decode the next map key as text.
Returns Ok(None) when the map is exhausted.
§Errors
Returns an error if decoding fails or the map is malformed.
Sourcepub fn next_value<T: CborDecode<'de>>(&mut self) -> Result<T, CborError>
pub fn next_value<T: CborDecode<'de>>(&mut self) -> Result<T, CborError>
Decode the value corresponding to the last returned key.
§Errors
Returns an error if decoding fails or the map is malformed.
Sourcepub fn decode_value<F, T>(&mut self, f: F) -> Result<T, CborError>
pub fn decode_value<F, T>(&mut self, f: F) -> Result<T, CborError>
Decode the value corresponding to the last returned key using a custom decoder.
§Errors
Returns an error if decoding fails or the map is malformed.
Sourcepub fn next_entry<V: CborDecode<'de>>(
&mut self,
) -> Result<Option<(&'de str, V)>, CborError>
pub fn next_entry<V: CborDecode<'de>>( &mut self, ) -> Result<Option<(&'de str, V)>, CborError>
Decode the next key/value entry in the map.
§Errors
Returns an error if decoding fails or the map is malformed.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'de, const CHECKED: bool> Freeze for MapDecoder<'a, 'de, CHECKED>
impl<'a, 'de, const CHECKED: bool> RefUnwindSafe for MapDecoder<'a, 'de, CHECKED>
impl<'a, 'de, const CHECKED: bool> Send for MapDecoder<'a, 'de, CHECKED>
impl<'a, 'de, const CHECKED: bool> Sync for MapDecoder<'a, 'de, CHECKED>
impl<'a, 'de, const CHECKED: bool> Unpin for MapDecoder<'a, 'de, CHECKED>
impl<'a, 'de, const CHECKED: bool> UnsafeUnpin for MapDecoder<'a, 'de, CHECKED>
impl<'a, 'de, const CHECKED: bool> !UnwindSafe for MapDecoder<'a, 'de, CHECKED>
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