pub struct MapVisitor<'a, 'b> { /* private fields */ }Expand description
A visitor for decoding map key-value pairs of different types.
Returned from Decoder::map_visitor.
Implementations§
Source§impl<'b> MapVisitor<'_, 'b>
impl<'b> MapVisitor<'_, 'b>
Sourcepub fn visit<K: Decode<'b>, V: Decode<'b>>(
&mut self,
) -> Option<Result<(K, V), Error<K::Error, V::Error>>>
pub fn visit<K: Decode<'b>, V: Decode<'b>>( &mut self, ) -> Option<Result<(K, V), Error<K::Error, V::Error>>>
Visit the next key-value pair in the map.
Sourcepub fn with_key<K, F, O>(&mut self, f: F) -> Option<Result<O, K::Error>>
pub fn with_key<K, F, O>(&mut self, f: F) -> Option<Result<O, K::Error>>
Visit the next key in the map, applying the given function to decode the value.
pub fn remaining(&self) -> Option<usize>
pub fn definite(&self) -> bool
Trait Implementations§
Source§impl<'a, 'b> Debug for MapVisitor<'a, 'b>
impl<'a, 'b> Debug for MapVisitor<'a, 'b>
Source§impl<'a, 'b> Hash for MapVisitor<'a, 'b>
impl<'a, 'b> Hash for MapVisitor<'a, 'b>
Source§impl<'a, 'b> PartialEq for MapVisitor<'a, 'b>
impl<'a, 'b> PartialEq for MapVisitor<'a, 'b>
impl<'a, 'b> Eq for MapVisitor<'a, 'b>
impl<'a, 'b> StructuralPartialEq for MapVisitor<'a, 'b>
Auto Trait Implementations§
impl<'a, 'b> Freeze for MapVisitor<'a, 'b>
impl<'a, 'b> RefUnwindSafe for MapVisitor<'a, 'b>
impl<'a, 'b> Send for MapVisitor<'a, 'b>
impl<'a, 'b> Sync for MapVisitor<'a, 'b>
impl<'a, 'b> Unpin for MapVisitor<'a, 'b>
impl<'a, 'b> !UnwindSafe for MapVisitor<'a, 'b>
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