pub struct SubordinateValue<V, K> {
pub value: V,
pub parent: K,
}Expand description
Utility type implementing MapValueAccess for the common case where a
value-access type consists only of a deserializable value, along with the
original MapKeyAccess type that produced it, which will be returned
after the value is consumed.
See the crate docs for an example.
Fields§
§value: VThe value that will be deserialized in next_value_seed.
parent: KThe MapKeyAccess object that will be returned along with value,
after it was deserialized. Usually this will be the same object that
created this SubordinateValue in the first place.
Trait Implementations§
Source§impl<V: Clone, K: Clone> Clone for SubordinateValue<V, K>
impl<V: Clone, K: Clone> Clone for SubordinateValue<V, K>
Source§fn clone(&self) -> SubordinateValue<V, K>
fn clone(&self) -> SubordinateValue<V, K>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, K, V> MapValueAccess<'de> for SubordinateValue<V, K>
impl<'de, K, V> MapValueAccess<'de> for SubordinateValue<V, K>
Source§type Error = <V as Deserializer<'de>>::Error
type Error = <V as Deserializer<'de>>::Error
The type that can be returned if an error occurs during deserialization.
Source§type Key = K
type Key = K
The value accessor associated with this key accessor. A call to
next_value will also return a Key object, which can
be used to retrieve the next key from the map.Source§fn next_value_seed<S>(
self,
seed: S,
) -> Result<(S::Value, Option<Self::Key>), Self::Error>where
S: DeserializeSeed<'de>,
fn next_value_seed<S>(
self,
seed: S,
) -> Result<(S::Value, Option<Self::Key>), Self::Error>where
S: DeserializeSeed<'de>,
This returns the next
value from the map, associated with the
previously accessed key. It additionally returns an optional key_access
object which can be used to retrieve additional keys from the map, if any. Read moreSource§fn size_hint(&self) -> Option<usize>
fn size_hint(&self) -> Option<usize>
Returns the number of entries remaining in the map, if known. Note that,
because this returns the number of entries, the value associated with
this particular
MapValueAccess should not be included.Source§fn next_value<T>(self) -> Result<(T, Option<Self::Key>), Self::Error>where
T: Deserialize<'de>,
fn next_value<T>(self) -> Result<(T, Option<Self::Key>), Self::Error>where
T: Deserialize<'de>,
This returns the next
value from the map, associated with the
previously accessed key. It additionally returns an optional key_access
object which can be used to retrieve additional keys from the map, if any.Auto Trait Implementations§
impl<V, K> Freeze for SubordinateValue<V, K>
impl<V, K> RefUnwindSafe for SubordinateValue<V, K>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<V, K> Send for SubordinateValue<V, K>
impl<V, K> Sync for SubordinateValue<V, K>
impl<V, K> Unpin for SubordinateValue<V, K>
impl<V, K> UnwindSafe for SubordinateValue<V, K>where
V: UnwindSafe,
K: UnwindSafe,
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