Expand description
Building blocks for deserializing basic values using the IntoDeserializer
trait.
โ
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())
}
}
Modulesยง
- private ๐
Macrosยง
- impl_copy_clone ๐
Structsยง
- A deserializer holding a
bool
. - A deserializer holding a
&[u8]
with a lifetime tied to another deserializer. Always callsVisitor::visit_borrowed_bytes
. - A deserializer holding a
&str
with a lifetime tied to another deserializer. - A deserializer holding a
&[u8]
. Always callsVisitor::visit_bytes
. - A deserializer holding a
char
. - A deserializer holding a
Cow<str>
. - A deserializer holding an
EnumAccess
. - A minimal representation of all possible errors that can occur using the
IntoDeserializer
trait. - ExpectedInMap ๐
- ExpectedInSeq ๐
- A deserializer holding an
f32
. - A deserializer holding an
f64
. - A deserializer holding an
i8
. - A deserializer holding an
i16
. - A deserializer holding an
i32
. - A deserializer holding an
i64
. - A deserializer holding an
i128
. - A deserializer holding an
isize
. - A deserializer holding a
MapAccess
. - A deserializer that iterates over a map.
- PairDeserializer ๐
- PairVisitor ๐
- A deserializer holding a
SeqAccess
. - A deserializer that iterates over a sequence.
- A deserializer holding a
&str
. - A deserializer holding a
String
. - A deserializer holding a
u8
. - A deserializer holding a
u16
. - A deserializer holding a
u32
. - A deserializer holding a
u64
. - A deserializer holding a
u128
. - A deserializer holding a
()
. - A deserializer holding a
usize
.
Type Aliasesยง
- ErrorImpl ๐