Module serde::de::value [] [src]

Building blocks for deserializing basic values using the IntoDeserializer trait.

#[macro_use]
extern crate serde_derive;

extern crate serde;

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

#[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())
    }
}

Structs

BoolDeserializer

A deserializer holding a bool.

BorrowedBytesDeserializer

A deserializer holding a &[u8] with a lifetime tied to another deserializer.

BorrowedStrDeserializer

A deserializer holding a &str with a lifetime tied to another deserializer.

CharDeserializer

A deserializer holding a char.

CowStrDeserializer

A deserializer holding a Cow<str>.

Error

A minimal representation of all possible errors that can occur using the IntoDeserializer trait.

F32Deserializer

A deserializer holding an f32.

F64Deserializer

A deserializer holding an f64.

I128Deserializer

A deserializer holding an i128.

I16Deserializer

A deserializer holding an i16.

I32Deserializer

A deserializer holding an i32.

I64Deserializer

A deserializer holding an i64.

I8Deserializer

A deserializer holding an i8.

IsizeDeserializer

A deserializer holding an isize.

MapAccessDeserializer

A deserializer holding a MapAccess.

MapDeserializer

A deserializer that iterates over a map.

SeqAccessDeserializer

A deserializer holding a SeqAccess.

SeqDeserializer

A deserializer that iterates over a sequence.

StrDeserializer

A deserializer holding a &str.

StringDeserializer

A deserializer holding a String.

U128Deserializer

A deserializer holding a u128.

U16Deserializer

A deserializer holding a u16.

U32Deserializer

A deserializer holding a u32.

U64Deserializer

A deserializer holding a u64.

U8Deserializer

A deserializer holding a u8.

UnitDeserializer

A deserializer holding a ().

UsizeDeserializer

A deserializer holding a usize.