Trait gclient::ext::sp_core::serde::de::IntoDeserializer

source ·
pub trait IntoDeserializer<'de, E = Error>
where E: Error,
{ type Deserializer: Deserializer<'de, Error = E>; // Required method fn into_deserializer(self) -> Self::Deserializer; }
Expand description

Converts an existing value into a Deserializer from which other values can be deserialized.

§Lifetime

The 'de lifetime of this trait is the lifetime of data that may be borrowed from the resulting Deserializer. See the page Understanding deserializer lifetimes for a more detailed explanation of these lifetimes.

§Example

use serde::de::{value, Deserialize, IntoDeserializer};
use serde_derive::Deserialize;
use std::str::FromStr;

#[derive(Deserialize)]
enum Setting {
    On,
    Off,
}

impl FromStr for Setting {
    type Err = value::Error;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Self::deserialize(s.into_deserializer())
    }
}

Required Associated Types§

source

type Deserializer: Deserializer<'de, Error = E>

The type of the deserializer being converted into.

Required Methods§

source

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.

Implementations on Foreign Types§

source§

impl<'de> IntoDeserializer<'de, Error> for &'de Value

source§

impl<'de> IntoDeserializer<'de, Error> for &'de RawValue

source§

impl<'de> IntoDeserializer<'de, Error> for Value

§

impl<'de> IntoDeserializer<'de, DeserializerError> for Primitive

§

type Deserializer = Primitive

§

fn into_deserializer( self, ) -> <Primitive as IntoDeserializer<'de, DeserializerError>>::Deserializer

source§

impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a str
where E: Error,

source§

impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a [u8]
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for bool
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for char
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for f32
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for f64
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for i8
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for i16
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for i32
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for i64
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for i128
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for isize
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for u8
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for u16
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for u32
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for u64
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for u128
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for ()
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for usize
where E: Error,

source§

impl<'de, K, V, S, E> IntoDeserializer<'de, E> for HashMap<K, V, S>
where K: IntoDeserializer<'de, E> + Eq + Hash, V: IntoDeserializer<'de, E>, S: BuildHasher, E: Error,

source§

impl<'de, K, V, S, E> IntoDeserializer<'de, E> for IndexMap<K, V, S>
where K: IntoDeserializer<'de, E> + Eq + Hash, V: IntoDeserializer<'de, E>, S: BuildHasher, E: Error,

§

impl<'de, K, V, S, E> IntoDeserializer<'de, E> for IndexMap<K, V, S>
where K: IntoDeserializer<'de, E> + Eq + Hash, V: IntoDeserializer<'de, E>, S: BuildHasher, E: Error,

§

type Deserializer = MapDeserializer<'de, <IndexMap<K, V, S> as IntoIterator>::IntoIter, E>

§

fn into_deserializer( self, ) -> <IndexMap<K, V, S> as IntoDeserializer<'de, E>>::Deserializer

§

impl<'de, T> IntoDeserializer<'de, DeserializerError> for Composite<T>

§

type Deserializer = Composite<T>

§

fn into_deserializer( self, ) -> <Composite<T> as IntoDeserializer<'de, DeserializerError>>::Deserializer

§

impl<'de, T> IntoDeserializer<'de, DeserializerError> for Value<T>

§

type Deserializer = Value<T>

§

fn into_deserializer( self, ) -> <Value<T> as IntoDeserializer<'de, DeserializerError>>::Deserializer

§

impl<'de, T> IntoDeserializer<'de, DeserializerError> for Variant<T>

§

type Deserializer = Variant<T>

§

fn into_deserializer( self, ) -> <Variant<T> as IntoDeserializer<'de, DeserializerError>>::Deserializer

source§

impl<'de, T, S, E> IntoDeserializer<'de, E> for HashSet<T, S>
where T: IntoDeserializer<'de, E> + Eq + Hash, S: BuildHasher, E: Error,

source§

impl<'de, T, S, E> IntoDeserializer<'de, E> for IndexSet<T, S>
where T: IntoDeserializer<'de, E> + Eq + Hash, S: BuildHasher, E: Error,

§

impl<'de, T, S, E> IntoDeserializer<'de, E> for IndexSet<T, S>
where T: IntoDeserializer<'de, E> + Eq + Hash, S: BuildHasher, E: Error,

§

type Deserializer = SeqDeserializer<<IndexSet<T, S> as IntoIterator>::IntoIter, E>

§

fn into_deserializer( self, ) -> <IndexSet<T, S> as IntoDeserializer<'de, E>>::Deserializer

Implementors§

source§

impl<'de, 'a, E> IntoDeserializer<'de, E> for Cow<'a, str>
where E: Error,

source§

impl<'de, E> IntoDeserializer<'de, E> for String
where E: Error,

source§

impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
where K: IntoDeserializer<'de, E> + Eq + Ord, V: IntoDeserializer<'de, E>, E: Error,

source§

impl<'de, T, E> IntoDeserializer<'de, E> for Vec<T>
where T: IntoDeserializer<'de, E>, E: Error,

source§

impl<'de, T, E> IntoDeserializer<'de, E> for BTreeSet<T>
where T: IntoDeserializer<'de, E> + Eq + Ord, E: Error,