Expand description
Serialization helpers for raw and canonical JSON values.
The conversion functions bridge Serde values to Rumaβs raw and canonical
representations. A generic deserializer adapts string-backed fields to types
implementing FromStr, and a lenient one reads a boolean that may arrive
spelled as a string.
Re-exportsΒ§
use std::borrow::Cow;πuse std::fmt;πuse std::io;πuse std::marker::PhantomData;πuse std::str::FromStr;πuse ruma::CanonicalJsonError;πuse ruma::CanonicalJsonObject;πuse ruma::canonical_json::try_from_json_map;πuse ruma::serde::Raw;πuse serde::Deserialize;πuse serde::Deserialize;πuse serde::Deserializer;πuse serde::de::IgnoredAny;πuse crate::Result;π
StructsΒ§
- Counter π
- An
io::Writesink that counts bytes without buffering them.
EnumsΒ§
- Lenient
Bool π - A boolean as a loosely typed source may spell it.
FunctionsΒ§
- deserialize_
from_ str - Deserializes a string and parses it through
FromStr. - deserialize_
lenient_ bool - Deserializes an optional boolean that may arrive spelled as a string.
- serialized_
len - Measures the length of a valueβs JSON serialization.
- to_
canonical_ object - Converts a serializable value into a canonical JSON object.
- to_raw
- Serializes a value into Rumaβs raw JSON representation.