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

Expand description

Building blocks for deserializing basic values using the IntoDeserializer trait.

use std::str::FromStr;
use serde::Deserialize;
use serde::de::{value, 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. Always calls Visitor::visit_borrowed_bytes.

BorrowedStrDeserializer

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

BytesDeserializer

A deserializer holding a &[u8]. Always calls Visitor::visit_bytes.

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.

I8Deserializer

A deserializer holding an i8.

I16Deserializer

A deserializer holding an i16.

I32Deserializer

A deserializer holding an i32.

I64Deserializer

A deserializer holding an i64.

I128Deserializer

A deserializer holding an i128.

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.

U8Deserializer

A deserializer holding a u8.

U16Deserializer

A deserializer holding a u16.

U32Deserializer

A deserializer holding a u32.

U64Deserializer

A deserializer holding a u64.

U128Deserializer

A deserializer holding a u128.

UnitDeserializer

A deserializer holding a ().

UsizeDeserializer

A deserializer holding a usize.