pub enum AccessAdapter<T, V> {
Ready(T),
Value(V),
Done,
}Expand description
Adapter type for converting the serde-mobile traits into serde’s &mut self
oriented traits. It uses an enum to track the state of the accessors.
Because the underlying traits use a move-oriented interface to prevent calls
after returning None, this object is guaranteed to be “fused”, meaning that
next_key or next_element will always continue return None when the
underlying collection is exhausted.
This type can be used for both serde::de::SeqAccess and
serde::de::MapAccess.
Variants§
Ready(T)
The AccessAdapter is ready to yield the next value from K. This is
the next element for SeqAccess or the next key for a MapAccess.
Value(V)
The AccessAdapter is ready to yield the value associated with a
recently yielded key for a MapAccess. SeqAccess adapters can never
be in this state.
Done
The AccessAdapter is empty; no more items will be yielded from it.
Implementations§
Source§impl<T, V> AccessAdapter<T, V>
impl<T, V> AccessAdapter<T, V>
Trait Implementations§
Source§impl<T: Clone, V: Clone> Clone for AccessAdapter<T, V>
impl<T: Clone, V: Clone> Clone for AccessAdapter<T, V>
Source§fn clone(&self) -> AccessAdapter<T, V>
fn clone(&self) -> AccessAdapter<T, V>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, A> MapAccess<'de> for AccessAdapter<A, A::Value>where
A: MapKeyAccess<'de>,
impl<'de, A> MapAccess<'de> for AccessAdapter<A, A::Value>where
A: MapKeyAccess<'de>,
Source§type Error = <A as MapKeyAccess<'de>>::Error
type Error = <A as MapKeyAccess<'de>>::Error
Source§fn next_key_seed<S>(&mut self, seed: S) -> Result<Option<S::Value>, Self::Error>where
S: DeserializeSeed<'de>,
fn next_key_seed<S>(&mut self, seed: S) -> Result<Option<S::Value>, Self::Error>where
S: DeserializeSeed<'de>,
Ok(Some(key)) for the next key in the map, or Ok(None)
if there are no more remaining entries. Read moreSource§fn next_value_seed<S>(&mut self, seed: S) -> Result<S::Value, Self::Error>where
S: DeserializeSeed<'de>,
fn next_value_seed<S>(&mut self, seed: S) -> Result<S::Value, Self::Error>where
S: DeserializeSeed<'de>,
Ok(value) for the next value in the map. Read moreSource§fn next_entry_seed<K, V>(
&mut self,
key: K,
value: V,
) -> Result<Option<(K::Value, V::Value)>, Self::Error>where
K: DeserializeSeed<'de>,
V: DeserializeSeed<'de>,
fn next_entry_seed<K, V>(
&mut self,
key: K,
value: V,
) -> Result<Option<(K::Value, V::Value)>, Self::Error>where
K: DeserializeSeed<'de>,
V: DeserializeSeed<'de>,
Ok(Some((key, value))) for the next (key-value) pair in
the map, or Ok(None) if there are no more remaining items. Read moreSource§fn size_hint(&self) -> Option<usize>
fn size_hint(&self) -> Option<usize>
Source§fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error>where
K: Deserialize<'de>,
fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error>where
K: Deserialize<'de>,
Ok(Some(key)) for the next key in the map, or Ok(None)
if there are no more remaining entries. Read moreSource§fn next_value<V>(&mut self) -> Result<V, Self::Error>where
V: Deserialize<'de>,
fn next_value<V>(&mut self) -> Result<V, Self::Error>where
V: Deserialize<'de>,
Ok(value) for the next value in the map. Read moreSource§fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>where
K: Deserialize<'de>,
V: Deserialize<'de>,
fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>where
K: Deserialize<'de>,
V: Deserialize<'de>,
Ok(Some((key, value))) for the next (key-value) pair in
the map, or Ok(None) if there are no more remaining items. Read moreSource§impl<'de, S> SeqAccess<'de> for AccessAdapter<S, Infallible>where
S: SeqAccess<'de>,
Implementation of serde::de::SeqAccess, using SeqAccess. An internal
enum is used to track the
impl<'de, S> SeqAccess<'de> for AccessAdapter<S, Infallible>where
S: SeqAccess<'de>,
Implementation of serde::de::SeqAccess, using SeqAccess. An internal
enum is used to track the
Source§type Error = <S as SeqAccess<'de>>::Error
type Error = <S as SeqAccess<'de>>::Error
Source§fn next_element_seed<T>(
&mut self,
seed: T,
) -> Result<Option<T::Value>, Self::Error>where
T: DeserializeSeed<'de>,
fn next_element_seed<T>(
&mut self,
seed: T,
) -> Result<Option<T::Value>, Self::Error>where
T: DeserializeSeed<'de>,
Ok(Some(value)) for the next value in the sequence, or
Ok(None) if there are no more remaining items. Read moreSource§fn size_hint(&self) -> Option<usize>
fn size_hint(&self) -> Option<usize>
Source§fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>where
T: Deserialize<'de>,
fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>where
T: Deserialize<'de>,
Ok(Some(value)) for the next value in the sequence, or
Ok(None) if there are no more remaining items. Read more