[]Module astral::thirdparty::serde::de::value

Building blocks for deserializing basic values using the IntoDeserializer trait.

This code runs with edition 2018
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.

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.

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.