pub struct Visitor<'a, K, Kc: ?Sized + 'a, F, S> { /* private fields */ }
Expand description
A visitor that can be used to deserialize a map-based adjacently tagged value.
This visitor handles a map-based adjacently tagged value, which is represented by a map containing exactly two entries. One entry of this tuple is a mapping from tag-key to tag, the other entry contains a mapping from value-key to value. Thus this visitor will return an error if the visited type is not a map with two entries.
The SeedFactory
provided to this visitor
provides a serde::de::DeserializeSeed
implementation depending on the tag,
which then determines how the value is going to be deserialized.
See de
for more information on
SeedFactory
and implementations thereof.
§Note
If you do not need to choose a specific deserialization-method based on the
tag, you should prefer KnownVisitor
to this visitor.
Implementations§
Trait Implementations§
source§impl<'de, 'a, K, Kc: ?Sized, F, S> Visitor<'de> for Visitor<'a, K, Kc, F, S>where
K: Deserialize<'de> + PartialEq<&'a Kc>,
F: SeedFactory<'de, S::Value>,
S: DeserializeSeed<'de>,
impl<'de, 'a, K, Kc: ?Sized, F, S> Visitor<'de> for Visitor<'a, K, Kc, F, S>where
K: Deserialize<'de> + PartialEq<&'a Kc>,
F: SeedFactory<'de, S::Value>,
S: DeserializeSeed<'de>,
§type Value = <F as SeedFactory<'de, <S as DeserializeSeed<'de>>::Value>>::Value
type Value = <F as SeedFactory<'de, <S as DeserializeSeed<'de>>::Value>>::Value
source§fn expecting(&self, fmt: &mut Formatter<'_>) -> Result
fn expecting(&self, fmt: &mut Formatter<'_>) -> Result
source§fn visit_map<A>(self, map: A) -> Result<Self::Value, A::Error>where
A: MapAccess<'de>,
fn visit_map<A>(self, map: A) -> Result<Self::Value, A::Error>where
A: MapAccess<'de>,
source§fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>where
E: Error,
fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>where
E: Error,
source§fn visit_i8<E>(self, v: i8) -> Result<Self::Value, E>where
E: Error,
fn visit_i8<E>(self, v: i8) -> Result<Self::Value, E>where
E: Error,
i8
. Read moresource§fn visit_i16<E>(self, v: i16) -> Result<Self::Value, E>where
E: Error,
fn visit_i16<E>(self, v: i16) -> Result<Self::Value, E>where
E: Error,
i16
. Read moresource§fn visit_i32<E>(self, v: i32) -> Result<Self::Value, E>where
E: Error,
fn visit_i32<E>(self, v: i32) -> Result<Self::Value, E>where
E: Error,
i32
. Read moresource§fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>where
E: Error,
fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>where
E: Error,
i64
. Read moresource§fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>where
E: Error,
fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>where
E: Error,
i128
. Read moresource§fn visit_u8<E>(self, v: u8) -> Result<Self::Value, E>where
E: Error,
fn visit_u8<E>(self, v: u8) -> Result<Self::Value, E>where
E: Error,
u8
. Read moresource§fn visit_u16<E>(self, v: u16) -> Result<Self::Value, E>where
E: Error,
fn visit_u16<E>(self, v: u16) -> Result<Self::Value, E>where
E: Error,
u16
. Read moresource§fn visit_u32<E>(self, v: u32) -> Result<Self::Value, E>where
E: Error,
fn visit_u32<E>(self, v: u32) -> Result<Self::Value, E>where
E: Error,
u32
. Read moresource§fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>where
E: Error,
fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>where
E: Error,
u64
. Read moresource§fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>where
E: Error,
fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>where
E: Error,
u128
. Read moresource§fn visit_f32<E>(self, v: f32) -> Result<Self::Value, E>where
E: Error,
fn visit_f32<E>(self, v: f32) -> Result<Self::Value, E>where
E: Error,
f32
. Read moresource§fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>where
E: Error,
fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>where
E: Error,
f64
. Read moresource§fn visit_char<E>(self, v: char) -> Result<Self::Value, E>where
E: Error,
fn visit_char<E>(self, v: char) -> Result<Self::Value, E>where
E: Error,
char
. Read moresource§fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>where
E: Error,
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>where
E: Error,
source§fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>where
E: Error,
fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>where
E: Error,
Deserializer
. Read moresource§fn visit_string<E>(self, v: String) -> Result<Self::Value, E>where
E: Error,
fn visit_string<E>(self, v: String) -> Result<Self::Value, E>where
E: Error,
Visitor
. Read moresource§fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>where
E: Error,
fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>where
E: Error,
source§fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E>where
E: Error,
fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E>where
E: Error,
Deserializer
. Read moresource§fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>where
E: Error,
fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>where
E: Error,
Visitor
. Read moresource§fn visit_none<E>(self) -> Result<Self::Value, E>where
E: Error,
fn visit_none<E>(self) -> Result<Self::Value, E>where
E: Error,
source§fn visit_some<D>(
self,
deserializer: D,
) -> Result<Self::Value, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn visit_some<D>(
self,
deserializer: D,
) -> Result<Self::Value, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§fn visit_unit<E>(self) -> Result<Self::Value, E>where
E: Error,
fn visit_unit<E>(self) -> Result<Self::Value, E>where
E: Error,
()
. Read more