serde_with

Trait DeserializeAs

Source
pub trait DeserializeAs<'de, T>: Sized {
    // Required method
    fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>
       where D: Deserializer<'de>;
}
Expand description

A data structure that can be deserialized from any data format supported by Serde, analogue to Deserialize.

The trait is analogue to the serde::Deserialize trait, with the same meaning of input and output arguments. It can and should be implemented using the same code structure as the Deserialize trait. As such, the same advice for implementing Deserialize applies here.

§Differences to Deserialize

The trait is only required for container-like types or types implementing specific conversion functions. Container-like types are Vec, BTreeMap, but also Option and Box. Conversion types deserialize into a different Rust type. For example, DisplayFromStr uses the FromStr trait after deserializing a string and DurationSeconds creates a Duration from either String or integer values.

This code shows how to implement Deserialize for Box:

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Box<T> {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: Deserializer<'de>,
    {
        Ok(Box::new(Deserialize::deserialize(deserializer)?))
    }
}

and this code shows how to do the same using DeserializeAs:

impl<'de, T, U> DeserializeAs<'de, Box<T>> for Box<U>
where
    U: DeserializeAs<'de, T>,
{
    fn deserialize_as<D>(deserializer: D) -> Result<Box<T>, D::Error>
    where
        D: Deserializer<'de>,
    {
        Ok(Box::new(
            DeserializeAsWrap::<T, U>::deserialize(deserializer)?.into_inner(),
        ))
    }
}

It uses two type parameters, T and U instead of only one and performs the deserialization step using the DeserializeAsWrap type. The T type is the on the Rust side after deserialization, whereas the U type determines how the value will be deserialized. These two changes are usually enough to make a container type implement DeserializeAs.

DeserializeAsWrap is a piece of glue code which turns DeserializeAs into a serde compatible datatype, by converting all calls to deserialize into deserialize_as. This allows us to implement DeserializeAs such that it can be applied recursively throughout the whole data structure. This is mostly important for container types, such as Vec or BTreeMap. In a BTreeMap this allows us to specify two different serialization behaviors, one for key and one for value, using the DeserializeAs trait.

§Implementing a converter Type

This shows a simplified implementation for DisplayFromStr.

struct DisplayFromStr;

impl<'de, T> DeserializeAs<'de, T> for DisplayFromStr
where
    T: FromStr,
    T::Err: Display,
{
    fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = String::deserialize(deserializer).map_err(Error::custom)?;
        s.parse().map_err(Error::custom)
    }
}

Required Methods§

Source

fn deserialize_as<D>(deserializer: D) -> Result<T, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Option<(K, V)>> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Option<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Option<(K, V)>> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Option<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BinaryHeap<(K, V)>> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BinaryHeap<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BinaryHeap<(K, V)>> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BinaryHeap<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BTreeMap<K, V>> for Vec<(KAs, VAs)>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BTreeMap<K, V>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BTreeSet<(K, V)>> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BTreeSet<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BTreeSet<(K, V)>> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BTreeSet<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, LinkedList<(K, V)>> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<LinkedList<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, LinkedList<(K, V)>> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<LinkedList<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, VecDeque<(K, V)>> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<VecDeque<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, VecDeque<(K, V)>> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<VecDeque<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Vec<(K, V)>> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Vec<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Vec<(K, V)>> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Vec<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, HashMap<K, V>> for Vec<(KAs, VAs)>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Eq + Hash,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<HashMap<K, V>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, HashSet<(K, V)>> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Eq + Hash,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<HashSet<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, HashSet<(K, V)>> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Eq + Hash,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<HashSet<(K, V)>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs, const N: usize> DeserializeAs<'de, [(K, V); N]> for BTreeMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<[(K, V); N], D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, KAs, V, VAs, const N: usize> DeserializeAs<'de, [(K, V); N]> for HashMap<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<[(K, V); N], D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, V, KU, VU> DeserializeAs<'de, BTreeMap<K, V>> for BTreeMap<KU, VU>
where KU: DeserializeAs<'de, K>, VU: DeserializeAs<'de, V>, K: Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BTreeMap<K, V>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, K, V, KU, VU, S> DeserializeAs<'de, HashMap<K, V, S>> for HashMap<KU, VU, S>
where KU: DeserializeAs<'de, K>, VU: DeserializeAs<'de, V>, K: Eq + Hash, S: BuildHasher + Default,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<HashMap<K, V, S>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0> DeserializeAs<'de, (T0,)> for (As0,)
where As0: DeserializeAs<'de, T0>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<(T0,), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1> DeserializeAs<'de, (T0, T1)> for (As0, As1)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<(T0, T1), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2> DeserializeAs<'de, (T0, T1, T2)> for (As0, As1, As2)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<(T0, T1, T2), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3> DeserializeAs<'de, (T0, T1, T2, T3)> for (As0, As1, As2, As3)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<(T0, T1, T2, T3), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4> DeserializeAs<'de, (T0, T1, T2, T3, T4)> for (As0, As1, As2, As3, As4)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<(T0, T1, T2, T3, T4), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5)> for (As0, As1, As2, As3, As4, As5)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>,

Source§

fn deserialize_as<D>( deserializer: D, ) -> Result<(T0, T1, T2, T3, T4, T5), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6)> for (As0, As1, As2, As3, As4, As5, As6)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>,

Source§

fn deserialize_as<D>( deserializer: D, ) -> Result<(T0, T1, T2, T3, T4, T5, T6), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7)> for (As0, As1, As2, As3, As4, As5, As6, As7)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>,

Source§

fn deserialize_as<D>( deserializer: D, ) -> Result<(T0, T1, T2, T3, T4, T5, T6, T7), D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8, T9, As9> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8, As9)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>, As9: DeserializeAs<'de, T9>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8, T9, As9, T10, As10> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8, As9, As10)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>, As9: DeserializeAs<'de, T9>, As10: DeserializeAs<'de, T10>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8, T9, As9, T10, As10, T11, As11> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8, As9, As10, As11)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>, As9: DeserializeAs<'de, T9>, As10: DeserializeAs<'de, T10>, As11: DeserializeAs<'de, T11>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8, T9, As9, T10, As10, T11, As11, T12, As12> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8, As9, As10, As11, As12)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>, As9: DeserializeAs<'de, T9>, As10: DeserializeAs<'de, T10>, As11: DeserializeAs<'de, T11>, As12: DeserializeAs<'de, T12>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8, T9, As9, T10, As10, T11, As11, T12, As12, T13, As13> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8, As9, As10, As11, As12, As13)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>, As9: DeserializeAs<'de, T9>, As10: DeserializeAs<'de, T10>, As11: DeserializeAs<'de, T11>, As12: DeserializeAs<'de, T12>, As13: DeserializeAs<'de, T13>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8, T9, As9, T10, As10, T11, As11, T12, As12, T13, As13, T14, As14> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8, As9, As10, As11, As12, As13, As14)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>, As9: DeserializeAs<'de, T9>, As10: DeserializeAs<'de, T10>, As11: DeserializeAs<'de, T11>, As12: DeserializeAs<'de, T12>, As13: DeserializeAs<'de, T13>, As14: DeserializeAs<'de, T14>,

Source§

impl<'de, T0, As0, T1, As1, T2, As2, T3, As3, T4, As4, T5, As5, T6, As6, T7, As7, T8, As8, T9, As9, T10, As10, T11, As11, T12, As12, T13, As13, T14, As14, T15, As15> DeserializeAs<'de, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> for (As0, As1, As2, As3, As4, As5, As6, As7, As8, As9, As10, As11, As12, As13, As14, As15)
where As0: DeserializeAs<'de, T0>, As1: DeserializeAs<'de, T1>, As2: DeserializeAs<'de, T2>, As3: DeserializeAs<'de, T3>, As4: DeserializeAs<'de, T4>, As5: DeserializeAs<'de, T5>, As6: DeserializeAs<'de, T6>, As7: DeserializeAs<'de, T7>, As8: DeserializeAs<'de, T8>, As9: DeserializeAs<'de, T9>, As10: DeserializeAs<'de, T10>, As11: DeserializeAs<'de, T11>, As12: DeserializeAs<'de, T12>, As13: DeserializeAs<'de, T13>, As14: DeserializeAs<'de, T14>, As15: DeserializeAs<'de, T15>,

Source§

impl<'de, T, As, const N: usize> DeserializeAs<'de, [T; N]> for [As; N]
where As: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<[T; N], D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, TAs, E, EAs> DeserializeAs<'de, Result<T, E>> for Result<TAs, EAs>
where TAs: DeserializeAs<'de, T>, EAs: DeserializeAs<'de, E>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Result<T, E>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Option<T>> for Option<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Option<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Box<[T]>> for Box<[U]>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Box<[T]>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Box<T>> for Box<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Box<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, BinaryHeap<T>> for BinaryHeap<U>
where U: DeserializeAs<'de, T>, T: Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BinaryHeap<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, BTreeSet<T>> for BTreeSet<U>
where U: DeserializeAs<'de, T>, T: Ord,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<BTreeSet<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, LinkedList<T>> for LinkedList<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<LinkedList<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, VecDeque<T>> for VecDeque<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<VecDeque<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Rc<T>> for Rc<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Rc<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Weak<T>> for RcWeak<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<RcWeak<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Arc<T>> for Arc<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Arc<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Weak<T>> for ArcWeak<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<ArcWeak<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Vec<T>> for Vec<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Vec<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Cell<T>> for Cell<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Cell<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, RefCell<T>> for RefCell<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<RefCell<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, Mutex<T>> for Mutex<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<Mutex<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, RwLock<T>> for RwLock<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<RwLock<T>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T, U, S> DeserializeAs<'de, HashSet<T, S>> for HashSet<U, S>
where U: DeserializeAs<'de, T>, T: Eq + Hash, S: BuildHasher + Default,

Source§

fn deserialize_as<D>(deserializer: D) -> Result<HashSet<T, S>, D::Error>
where D: Deserializer<'de>,

Implementors§

Source§

impl<'de> DeserializeAs<'de, &'de [u8]> for Bytes

Source§

impl<'de> DeserializeAs<'de, Cow<'de, str>> for BorrowCow

Source§

impl<'de> DeserializeAs<'de, Cow<'de, [u8]>> for BorrowCow

Source§

impl<'de> DeserializeAs<'de, Cow<'de, [u8]>> for Bytes

Source§

impl<'de> DeserializeAs<'de, bool> for BoolFromInt<Flexible>

Source§

impl<'de> DeserializeAs<'de, bool> for BoolFromInt<Strict>

Source§

impl<'de> DeserializeAs<'de, Box<[u8]>> for Bytes

Source§

impl<'de> DeserializeAs<'de, Vec<u8>> for Bytes

Source§

impl<'de> DeserializeAs<'de, Vec<u8>> for BytesOrString

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMicroSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMicroSeconds<u64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMicroSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMicroSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMicroSecondsWithFrac<String, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMilliSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMilliSeconds<u64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMilliSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMilliSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationMilliSecondsWithFrac<String, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationNanoSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationNanoSeconds<u64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationNanoSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationNanoSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationNanoSecondsWithFrac<String, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationSeconds<u64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, Duration> for DurationSecondsWithFrac<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMicroSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMicroSeconds<i64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMicroSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMicroSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMicroSecondsWithFrac<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMilliSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMilliSeconds<i64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMilliSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMilliSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampMilliSecondsWithFrac<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampNanoSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampNanoSeconds<i64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampNanoSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampNanoSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampNanoSecondsWithFrac<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampSeconds<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampSeconds<i64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampSeconds<String, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampSecondsWithFrac<f64, Strict>

Source§

impl<'de> DeserializeAs<'de, SystemTime> for TimestampSecondsWithFrac<String, Strict>

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationMicroSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationMicroSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationMilliSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationMilliSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationNanoSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationNanoSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, Duration> for DurationSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampMicroSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampMicroSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampMilliSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampMilliSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampNanoSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampNanoSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampSeconds<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, FORMAT> DeserializeAs<'de, SystemTime> for TimestampSecondsWithFrac<FORMAT, Flexible>
where FORMAT: Format,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BinaryHeap<(K, V)>> for Map<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Ord,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BTreeMap<K, V>> for Seq<(KAs, VAs)>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Ord,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, BTreeSet<(K, V)>> for Map<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Ord,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, LinkedList<(K, V)>> for Map<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, VecDeque<(K, V)>> for Map<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, Vec<(K, V)>> for Map<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V):,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, HashMap<K, V>> for Seq<(KAs, VAs)>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Eq + Hash,

Source§

impl<'de, K, KAs, V, VAs> DeserializeAs<'de, HashSet<(K, V)>> for Map<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, (K, V): Eq + Hash,

Source§

impl<'de, K, KAs, V, VAs, const N: usize> DeserializeAs<'de, [(K, V); N]> for Map<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>,

Source§

impl<'de, K, V, KAs, VAs> DeserializeAs<'de, BTreeMap<K, V>> for MapFirstKeyWins<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Ord,

Source§

impl<'de, K, V, KAs, VAs> DeserializeAs<'de, BTreeMap<K, V>> for MapPreventDuplicates<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Ord,

Source§

impl<'de, K, V, KAs, VAs, S> DeserializeAs<'de, HashMap<K, V, S>> for MapFirstKeyWins<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Eq + Hash, S: BuildHasher + Default,

Source§

impl<'de, K, V, KAs, VAs, S> DeserializeAs<'de, HashMap<K, V, S>> for MapPreventDuplicates<KAs, VAs>
where KAs: DeserializeAs<'de, K>, VAs: DeserializeAs<'de, V>, K: Eq + Hash, S: BuildHasher + Default,

Source§

impl<'de, SEPARATOR, I, T> DeserializeAs<'de, I> for StringWithSeparator<SEPARATOR, T>
where SEPARATOR: Separator, I: FromIterator<T>, T: FromStr, T::Err: Display,

Source§

impl<'de, Str> DeserializeAs<'de, Option<Str>> for NoneAsEmptyString
where Str: FromStr, Str::Err: Display,

Source§

impl<'de, T> DeserializeAs<'de, Vec<T>> for EnumMap
where T: Deserialize<'de>,

Source§

impl<'de, T> DeserializeAs<'de, T> for DisplayFromStr
where T: FromStr, T::Err: Display,

Source§

impl<'de, T, TAs1> DeserializeAs<'de, T> for PickFirst<(TAs1,)>
where TAs1: DeserializeAs<'de, T>,

Source§

impl<'de, T, TAs1, TAs2> DeserializeAs<'de, T> for PickFirst<(TAs1, TAs2)>
where TAs1: DeserializeAs<'de, T>, TAs2: DeserializeAs<'de, T>,

Source§

impl<'de, T, TAs1, TAs2, TAs3> DeserializeAs<'de, T> for PickFirst<(TAs1, TAs2, TAs3)>
where TAs1: DeserializeAs<'de, T>, TAs2: DeserializeAs<'de, T>, TAs3: DeserializeAs<'de, T>,

Source§

impl<'de, T, TAs1, TAs2, TAs3, TAs4> DeserializeAs<'de, T> for PickFirst<(TAs1, TAs2, TAs3, TAs4)>
where TAs1: DeserializeAs<'de, T>, TAs2: DeserializeAs<'de, T>, TAs3: DeserializeAs<'de, T>, TAs4: DeserializeAs<'de, T>,

Source§

impl<'de, T, TAs> DeserializeAs<'de, BTreeSet<T>> for SetLastValueWins<TAs>
where TAs: DeserializeAs<'de, T>, T: Ord,

Source§

impl<'de, T, TAs> DeserializeAs<'de, BTreeSet<T>> for SetPreventDuplicates<TAs>
where TAs: DeserializeAs<'de, T>, T: Ord,

Source§

impl<'de, T, TAs> DeserializeAs<'de, Vec<T>> for KeyValueMap<TAs>
where TAs: DeserializeAs<'de, T>,

Source§

impl<'de, T, TAs> DeserializeAs<'de, T> for DefaultOnError<TAs>
where TAs: DeserializeAs<'de, T>, T: Default,

Source§

impl<'de, T, TAs, FORMAT> DeserializeAs<'de, Vec<T>> for OneOrMany<TAs, FORMAT>
where TAs: DeserializeAs<'de, T>, FORMAT: Format,

Source§

impl<'de, T, TAs, S> DeserializeAs<'de, HashSet<T, S>> for SetLastValueWins<TAs>
where TAs: DeserializeAs<'de, T>, T: Eq + Hash, S: BuildHasher + Default,

Source§

impl<'de, T, TAs, S> DeserializeAs<'de, HashSet<T, S>> for SetPreventDuplicates<TAs>
where TAs: DeserializeAs<'de, T>, T: Eq + Hash, S: BuildHasher + Default,

Source§

impl<'de, T, U> DeserializeAs<'de, Vec<T>> for VecSkipError<U>
where U: DeserializeAs<'de, T>,

Source§

impl<'de, T, U> DeserializeAs<'de, T> for DefaultOnNull<U>
where U: DeserializeAs<'de, T>, T: Default,

Source§

impl<'de, T, U> DeserializeAs<'de, T> for FromInto<U>
where U: Into<T> + Deserialize<'de>,

Source§

impl<'de, T, U> DeserializeAs<'de, T> for TryFromInto<U>
where U: TryInto<T> + Deserialize<'de>, <U as TryInto<T>>::Error: Display,

Source§

impl<'de, T: Deserialize<'de>> DeserializeAs<'de, T> for Same

Source§

impl<'de, const N: usize> DeserializeAs<'de, &'de [u8; N]> for Bytes

Source§

impl<'de, const N: usize> DeserializeAs<'de, Cow<'de, [u8; N]>> for BorrowCow

Source§

impl<'de, const N: usize> DeserializeAs<'de, Cow<'de, [u8; N]>> for Bytes

Source§

impl<'de, const N: usize> DeserializeAs<'de, Box<[u8; N]>> for Bytes

Source§

impl<'de, const N: usize> DeserializeAs<'de, [u8; N]> for Bytes