# Crate Documentation **Version:** 1.0.228 **Format Version:** 56 # Module `serde` # Serde Serde is a framework for ***ser***ializing and ***de***serializing Rust data structures efficiently and generically. The Serde ecosystem consists of data structures that know how to serialize and deserialize themselves along with data formats that know how to serialize and deserialize other things. Serde provides the layer by which these two groups interact with each other, allowing any supported data structure to be serialized and deserialized using any supported data format. See the Serde website for additional documentation and usage examples. ## Design Where many other languages rely on runtime reflection for serializing data, Serde is instead built on Rust's powerful trait system. A data structure that knows how to serialize and deserialize itself is one that implements Serde's `Serialize` and `Deserialize` traits (or uses Serde's derive attribute to automatically generate implementations at compile time). This avoids any overhead of reflection or runtime type information. In fact in many situations the interaction between data structure and data format can be completely optimized away by the Rust compiler, leaving Serde serialization to perform the same speed as a handwritten serializer for the specific selection of data structure and data format. ## Data formats The following is a partial list of data formats that have been implemented for Serde by the community. - [JSON], the ubiquitous JavaScript Object Notation used by many HTTP APIs. - [Postcard], a no\_std and embedded-systems friendly compact binary format. - [CBOR], a Concise Binary Object Representation designed for small message size without the need for version negotiation. - [YAML], a self-proclaimed human-friendly configuration language that ain't markup language. - [MessagePack], an efficient binary format that resembles a compact JSON. - [TOML], a minimal configuration format used by [Cargo]. - [Pickle], a format common in the Python world. - [RON], a Rusty Object Notation. - [BSON], the data storage and network transfer format used by MongoDB. - [Avro], a binary format used within Apache Hadoop, with support for schema definition. - [JSON5], a superset of JSON including some productions from ES5. - [URL] query strings, in the x-www-form-urlencoded format. - [Starlark], the format used for describing build targets by the Bazel and Buck build systems. *(serialization only)* - [Envy], a way to deserialize environment variables into Rust structs. *(deserialization only)* - [Envy Store], a way to deserialize [AWS Parameter Store] parameters into Rust structs. *(deserialization only)* - [S-expressions], the textual representation of code and data used by the Lisp language family. - [D-Bus]'s binary wire format. - [FlexBuffers], the schemaless cousin of Google's FlatBuffers zero-copy serialization format. - [Bencode], a simple binary format used in the BitTorrent protocol. - [Token streams], for processing Rust procedural macro input. *(deserialization only)* - [DynamoDB Items], the format used by [rusoto_dynamodb] to transfer data to and from DynamoDB. - [Hjson], a syntax extension to JSON designed around human reading and editing. *(deserialization only)* - [CSV], Comma-separated values is a tabular text file format. [JSON]: https://github.com/serde-rs/json [Postcard]: https://github.com/jamesmunns/postcard [CBOR]: https://github.com/enarx/ciborium [YAML]: https://github.com/dtolnay/serde-yaml [MessagePack]: https://github.com/3Hren/msgpack-rust [TOML]: https://docs.rs/toml [Pickle]: https://github.com/birkenfeld/serde-pickle [RON]: https://github.com/ron-rs/ron [BSON]: https://github.com/mongodb/bson-rust [Avro]: https://docs.rs/apache-avro [JSON5]: https://github.com/callum-oakley/json5-rs [URL]: https://docs.rs/serde_qs [Starlark]: https://github.com/dtolnay/serde-starlark [Envy]: https://github.com/softprops/envy [Envy Store]: https://github.com/softprops/envy-store [Cargo]: https://doc.rust-lang.org/cargo/reference/manifest.html [AWS Parameter Store]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html [S-expressions]: https://github.com/rotty/lexpr-rs [D-Bus]: https://docs.rs/zvariant [FlexBuffers]: https://github.com/google/flatbuffers/tree/master/rust/flexbuffers [Bencode]: https://github.com/P3KI/bendy [Token streams]: https://github.com/oxidecomputer/serde_tokenstream [DynamoDB Items]: https://docs.rs/serde_dynamo [rusoto_dynamodb]: https://docs.rs/rusoto_dynamodb [Hjson]: https://github.com/Canop/deser-hjson [CSV]: https://docs.rs/csv ## Modules ## Module `de` **Attributes:** - `Other("#[(all(docsrs, if_docsrs_then_no_serde_core), path =\n\"core/de/mod.rs\")]")` - `Other("#[attr = Path(\"core/de/mod.rs\")]")` Generic data structure deserialization framework. The two most important traits in this module are [`Deserialize`] and [`Deserializer`]. - **A type that implements `Deserialize` is a data structure** that can be deserialized from any data format supported by Serde, and conversely - **A type that implements `Deserializer` is a data format** that can deserialize any data structure supported by Serde. # The Deserialize trait Serde provides [`Deserialize`] implementations for many Rust primitive and standard library types. The complete list is below. All of these can be deserialized using Serde out of the box. Additionally, Serde provides a procedural macro called [`serde_derive`] to automatically generate [`Deserialize`] implementations for structs and enums in your program. See the [derive section of the manual] for how to use this. In rare cases it may be necessary to implement [`Deserialize`] manually for some type in your program. See the [Implementing `Deserialize`] section of the manual for more about this. Third-party crates may provide [`Deserialize`] implementations for types that they expose. For example the [`linked-hash-map`] crate provides a [`LinkedHashMap`] type that is deserializable by Serde because the crate provides an implementation of [`Deserialize`] for it. # The Deserializer trait [`Deserializer`] implementations are provided by third-party crates, for example [`serde_json`], [`serde_yaml`] and [`postcard`]. A partial list of well-maintained formats is given on the [Serde website][data formats]. # Implementations of Deserialize provided by Serde This is a slightly different set of types than what is supported for serialization. Some types can be serialized by Serde but not deserialized. One example is `OsStr`. - **Primitive types**: - bool - i8, i16, i32, i64, i128, isize - u8, u16, u32, u64, u128, usize - f32, f64 - char - **Compound types**: - \[T; 0\] through \[T; 32\] - tuples up to size 16 - **Common standard library types**: - String - Option\ - Result\ - PhantomData\ - **Wrapper types**: - Box\ - Box\<\[T\]\> - Box\ - Cow\<'a, T\> - Cell\ - RefCell\ - Mutex\ - RwLock\ - Rc\ *(if* features = \["rc"\] *is enabled)* - Arc\ *(if* features = \["rc"\] *is enabled)* - **Collection types**: - BTreeMap\ - BTreeSet\ - BinaryHeap\ - HashMap\ - HashSet\ - LinkedList\ - VecDeque\ - Vec\ - **Zero-copy types**: - &str - &\[u8\] - **FFI types**: - CString - Box\ - OsString - **Miscellaneous standard library types**: - Duration - SystemTime - Path - PathBuf - Range\ - RangeInclusive\ - Bound\ - num::NonZero* - `!` *(unstable)* - **Net types**: - IpAddr - Ipv4Addr - Ipv6Addr - SocketAddr - SocketAddrV4 - SocketAddrV6 [Implementing `Deserialize`]: https://serde.rs/impl-deserialize.html [`Deserialize`]: crate::Deserialize [`Deserializer`]: crate::Deserializer [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html [`postcard`]: https://github.com/jamesmunns/postcard [`linked-hash-map`]: https://crates.io/crates/linked-hash-map [`serde_derive`]: https://crates.io/crates/serde_derive [`serde_json`]: https://github.com/serde-rs/json [`serde_yaml`]: https://github.com/dtolnay/serde-yaml [derive section of the manual]: https://serde.rs/derive.html [data formats]: https://serde.rs/#data-formats ```rust pub mod de { /* ... */ } ``` ### Modules ## Module `value` Building blocks for deserializing basic values using the `IntoDeserializer` trait. ```edition2021 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::deserialize(s.into_deserializer()) } } ``` ```rust pub mod value { /* ... */ } ``` ### Types #### Struct `Error` A minimal representation of all possible errors that can occur using the `IntoDeserializer` trait. ```rust pub struct Error { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Error { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Display** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Error** - ```rust fn custom(msg: T) -> Self where T: Display { /* ... */ } ``` - ```rust fn custom(msg: T) -> Self where T: Display { /* ... */ } ``` - ```rust fn description(self: &Self) -> &str { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **PartialEq** - ```rust fn eq(self: &Self, other: &Error) -> bool { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **StructuralPartialEq** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **ToString** - ```rust fn to_string(self: &Self) -> String { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `UnitDeserializer` A deserializer holding a `()`. ```rust pub struct UnitDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new() -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `NeverDeserializer` **Attributes:** - `Other("#[(feature = \"unstable\")]")` - `Other("#[(docsrs, doc(cfg(feature = \"unstable\")))]")` - `Other("#[doc(cfg(feature = \"unstable\"))]")` A deserializer that cannot be instantiated. ```rust pub struct NeverDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, _visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `BoolDeserializer` A deserializer holding a `bool`. ```rust pub struct BoolDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: bool) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `I8Deserializer` A deserializer holding an `i8`. ```rust pub struct I8Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: i8) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `I16Deserializer` A deserializer holding an `i16`. ```rust pub struct I16Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: i16) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `I32Deserializer` A deserializer holding an `i32`. ```rust pub struct I32Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: i32) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `I64Deserializer` A deserializer holding an `i64`. ```rust pub struct I64Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: i64) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `I128Deserializer` A deserializer holding an `i128`. ```rust pub struct I128Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: i128) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `IsizeDeserializer` A deserializer holding an `isize`. ```rust pub struct IsizeDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: isize) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `U8Deserializer` A deserializer holding a `u8`. ```rust pub struct U8Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: u8) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `U16Deserializer` A deserializer holding a `u16`. ```rust pub struct U16Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: u16) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `U64Deserializer` A deserializer holding a `u64`. ```rust pub struct U64Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: u64) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `U128Deserializer` A deserializer holding a `u128`. ```rust pub struct U128Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: u128) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `UsizeDeserializer` A deserializer holding a `usize`. ```rust pub struct UsizeDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: usize) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `F32Deserializer` A deserializer holding an `f32`. ```rust pub struct F32Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: f32) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `F64Deserializer` A deserializer holding an `f64`. ```rust pub struct F64Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: f64) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `CharDeserializer` A deserializer holding a `char`. ```rust pub struct CharDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: char) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `U32Deserializer` A deserializer holding a `u32`. ```rust pub struct U32Deserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: u32) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &str, variants: &''static [&''static str], visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - **EnumAccess** - ```rust fn variant_seed(self: Self, seed: T) -> Result<(::Value, ::Variant), ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `StrDeserializer` A deserializer holding a `&str`. ```rust pub struct StrDeserializer<''a, E> { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: &''a str) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &str, variants: &''static [&''static str], visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **EnumAccess** - ```rust fn variant_seed(self: Self, seed: T) -> Result<(::Value, ::Variant), ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `BorrowedStrDeserializer` A deserializer holding a `&str` with a lifetime tied to another deserializer. ```rust pub struct BorrowedStrDeserializer<''de, E> { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: &''de str) -> BorrowedStrDeserializer<''de, E> { /* ... */ } ``` Create a new borrowed deserializer from the given string. ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &str, variants: &''static [&''static str], visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **EnumAccess** - ```rust fn variant_seed(self: Self, seed: T) -> Result<(::Value, ::Variant), ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `StringDeserializer` **Attributes:** - `Other("#[(any(feature = \"std\", feature = \"alloc\"))]")` - `Other("#[(docsrs, doc(cfg(any(feature = \"std\", feature = \"alloc\"))))]")` - `Other("#[doc(cfg(any(feature = \"std\", feature = \"alloc\")))]")` A deserializer holding a `String`. ```rust pub struct StringDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: String) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &str, variants: &''static [&''static str], visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **EnumAccess** - ```rust fn variant_seed(self: Self, seed: T) -> Result<(::Value, ::Variant), ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `CowStrDeserializer` **Attributes:** - `Other("#[(any(feature = \"std\", feature = \"alloc\"))]")` - `Other("#[(docsrs, doc(cfg(any(feature = \"std\", feature = \"alloc\"))))]")` - `Other("#[doc(cfg(any(feature = \"std\", feature = \"alloc\")))]")` A deserializer holding a `Cow`. ```rust pub struct CowStrDeserializer<''a, E> { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: Cow<''a, str>) -> Self { /* ... */ } ``` ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &str, variants: &''static [&''static str], visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **EnumAccess** - ```rust fn variant_seed(self: Self, seed: T) -> Result<(::Value, ::Variant), ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `BytesDeserializer` A deserializer holding a `&[u8]`. Always calls [`Visitor::visit_bytes`]. ```rust pub struct BytesDeserializer<''a, E> { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: &''a [u8]) -> Self { /* ... */ } ``` Create a new deserializer from the given bytes. ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `BorrowedBytesDeserializer` A deserializer holding a `&[u8]` with a lifetime tied to another deserializer. Always calls [`Visitor::visit_borrowed_bytes`]. ```rust pub struct BorrowedBytesDeserializer<''de, E> { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(value: &''de [u8]) -> Self { /* ... */ } ``` Create a new borrowed deserializer from the given borrowed bytes. ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `SeqDeserializer` A deserializer that iterates over a sequence. ```rust pub struct SeqDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(iter: I) -> Self { /* ... */ } ``` Construct a new `SeqDeserializer`. - ```rust pub fn end(self: Self) -> Result<(), E> { /* ... */ } ``` Check for remaining elements after passing a `SeqDeserializer` to ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> SeqDeserializer { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **SeqAccess** - ```rust fn next_element_seed(self: &mut Self, seed: V) -> Result::Value>, ::Error> where V: de::DeserializeSeed<''de> { /* ... */ } ``` - ```rust fn size_hint(self: &Self) -> Option { /* ... */ } ``` - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `SeqAccessDeserializer` A deserializer holding a `SeqAccess`. ```rust pub struct SeqAccessDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(seq: A) -> Self { /* ... */ } ``` Construct a new `SeqAccessDeserializer`. ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> SeqAccessDeserializer { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `MapDeserializer` A deserializer that iterates over a map. ```rust pub struct MapDeserializer<''de, I, E> { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(iter: I) -> Self { /* ... */ } ``` Construct a new `MapDeserializer`. - ```rust pub fn end(self: Self) -> Result<(), E> { /* ... */ } ``` Check for remaining elements after passing a `MapDeserializer` to ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Self { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **MapAccess** - ```rust fn next_key_seed(self: &mut Self, seed: T) -> Result::Value>, ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - ```rust fn next_value_seed(self: &mut Self, seed: T) -> Result<::Value, ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - ```rust fn next_entry_seed(self: &mut Self, kseed: TK, vseed: TV) -> Result::Value, ::Value)>, ::Error> where TK: de::DeserializeSeed<''de>, TV: de::DeserializeSeed<''de> { /* ... */ } ``` - ```rust fn size_hint(self: &Self) -> Option { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **SeqAccess** - ```rust fn next_element_seed(self: &mut Self, seed: T) -> Result::Value>, ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - ```rust fn size_hint(self: &Self) -> Option { /* ... */ } ``` - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `MapAccessDeserializer` A deserializer holding a `MapAccess`. ```rust pub struct MapAccessDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(map: A) -> Self { /* ... */ } ``` Construct a new `MapAccessDeserializer`. ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> MapAccessDeserializer { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, _name: &str, _variants: &''static [&''static str], visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **EnumAccess** - ```rust fn variant_seed(self: Self, seed: T) -> Result<(::Value, ::Variant), ::Error> where T: de::DeserializeSeed<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** #### Struct `EnumAccessDeserializer` A deserializer holding an `EnumAccess`. ```rust pub struct EnumAccessDeserializer { // Some fields omitted } ``` ##### Fields | Name | Type | Documentation | |------|------|---------------| | *private fields* | ... | *Some fields have been omitted* | ##### Implementations ###### Methods - ```rust pub fn new(access: A) -> Self { /* ... */ } ``` Construct a new `EnumAccessDeserializer`. ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> EnumAccessDeserializer { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Debug** - ```rust fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ } ``` - **Deserializer** - ```rust fn deserialize_any(self: Self, visitor: V) -> Result<::Value, ::Error> where V: de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bool(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_i128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u8(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u16(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_u128(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f32(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_f64(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_char(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_str(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_string(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_bytes(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_byte_buf(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_option(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_unit_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_newtype_struct(self: Self, name: &''static str, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_seq(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple(self: Self, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_tuple_struct(self: Self, name: &''static str, len: usize, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_map(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_struct(self: Self, name: &''static str, fields: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_enum(self: Self, name: &''static str, variants: &''static [&''static str], visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_identifier(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - ```rust fn deserialize_ignored_any(self: Self, visitor: V) -> $crate::__private::Result<::Value, >::Error> where V: $crate::de::Visitor<''de> { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **IntoDeserializer** - ```rust fn into_deserializer(self: Self) -> Self { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** ### Types #### Enum `Unexpected` `Unexpected` represents an unexpected invocation of any one of the `Visitor` trait methods. This is used as an argument to the `invalid_type`, `invalid_value`, and `invalid_length` methods of the `Error` trait to build error messages. ```edition2021 # use std::fmt; # # use serde::de::{self, Unexpected, Visitor}; # # struct Example; # # impl<'de> Visitor<'de> for Example { # type Value = (); # # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { # write!(formatter, "definitely not a boolean") # } # fn visit_bool(self, v: bool) -> Result where E: de::Error, { Err(de::Error::invalid_type(Unexpected::Bool(v), &self)) } # } ``` ```rust pub enum Unexpected<''a> { Bool(bool), Unsigned(u64), Signed(i64), Float(f64), Char(char), Str(&''a str), Bytes(&''a [u8]), Unit, Option, NewtypeStruct, Seq, Map, Enum, UnitVariant, NewtypeVariant, TupleVariant, StructVariant, Other(&''a str), } ``` ##### Variants ###### `Bool` The input contained a boolean value that was not expected. Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `bool` | | ###### `Unsigned` The input contained an unsigned integer `u8`, `u16`, `u32` or `u64` that was not expected. Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `u64` | | ###### `Signed` The input contained a signed integer `i8`, `i16`, `i32` or `i64` that was not expected. Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `i64` | | ###### `Float` The input contained a floating point `f32` or `f64` that was not expected. Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `f64` | | ###### `Char` The input contained a `char` that was not expected. Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `char` | | ###### `Str` The input contained a `&str` or `String` that was not expected. Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `&''a str` | | ###### `Bytes` The input contained a `&[u8]` or `Vec` that was not expected. Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `&''a [u8]` | | ###### `Unit` The input contained a unit `()` that was not expected. ###### `Option` The input contained an `Option` that was not expected. ###### `NewtypeStruct` The input contained a newtype struct that was not expected. ###### `Seq` The input contained a sequence that was not expected. ###### `Map` The input contained a map that was not expected. ###### `Enum` The input contained an enum that was not expected. ###### `UnitVariant` The input contained a unit variant that was not expected. ###### `NewtypeVariant` The input contained a newtype variant that was not expected. ###### `TupleVariant` The input contained a tuple variant that was not expected. ###### `StructVariant` The input contained a struct variant that was not expected. ###### `Other` A message stating what uncategorized thing the input contained that was not expected. The message should be a noun or noun phrase, not capitalized and without a period. An example message is "unoriginal superhero". Fields: | Index | Type | Documentation | |-------|------|---------------| | 0 | `&''a str` | | ##### Implementations ###### Trait Implementations - **Any** - ```rust fn type_id(self: &Self) -> TypeId { /* ... */ } ``` - **Borrow** - ```rust fn borrow(self: &Self) -> &T { /* ... */ } ``` - **BorrowMut** - ```rust fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } ``` - **Clone** - ```rust fn clone(self: &Self) -> Unexpected<''a> { /* ... */ } ``` - **CloneToUninit** - ```rust unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ } ``` - **Copy** - **Debug** - ```rust fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ } ``` - **Display** - ```rust fn fmt(self: &Self, formatter: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ } ``` - **Freeze** - **From** - ```rust fn from(t: T) -> T { /* ... */ } ``` Returns the argument unchanged. - **Into** - ```rust fn into(self: Self) -> U { /* ... */ } ``` Calls `U::from(self)`. - **PartialEq** - ```rust fn eq(self: &Self, other: &Unexpected<''a>) -> bool { /* ... */ } ``` - **RefUnwindSafe** - **Send** - **StructuralPartialEq** - **Sync** - **ToOwned** - ```rust fn to_owned(self: &Self) -> T { /* ... */ } ``` - ```rust fn clone_into(self: &Self, target: &mut T) { /* ... */ } ``` - **ToString** - ```rust fn to_string(self: &Self) -> String { /* ... */ } ``` - **TryFrom** - ```rust fn try_from(value: U) -> Result>::Error> { /* ... */ } ``` - **TryInto** - ```rust fn try_into(self: Self) -> Result>::Error> { /* ... */ } ``` - **Unpin** - **UnwindSafe** ### Traits #### Trait `Error` **Attributes:** - `Other("#[(not(no_diagnostic_namespace), diagnostic ::\non_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Error` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Error` is not satisfied\",)]")` The `Error` trait allows `Deserialize` implementations to create descriptive error messages belonging to the `Deserializer` against which they are currently running. Every `Deserializer` declares an `Error` type that encompasses both general-purpose deserialization errors as well as errors specific to the particular deserialization format. For example the `Error` type of `serde_json` can represent errors like an invalid JSON escape sequence or an unterminated string literal, in addition to the error cases that are part of this trait. Most deserializers should only need to provide the `Error::custom` method and inherit the default behavior for the other methods. # Example implementation The [example data format] presented on the website shows an error type appropriate for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait Error: Sized + StdError { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Required Methods - `custom`: Raised when there is general error when deserializing a type. ##### Provided Methods - ```rust fn invalid_type(unexp: Unexpected<''_>, exp: &dyn Expected) -> Self { /* ... */ } ``` Raised when a `Deserialize` receives a type different from what it was - ```rust fn invalid_value(unexp: Unexpected<''_>, exp: &dyn Expected) -> Self { /* ... */ } ``` Raised when a `Deserialize` receives a value of the right type but that - ```rust fn invalid_length(len: usize, exp: &dyn Expected) -> Self { /* ... */ } ``` Raised when deserializing a sequence or map and the input data contains - ```rust fn unknown_variant(variant: &str, expected: &''static [&''static str]) -> Self { /* ... */ } ``` Raised when a `Deserialize` enum type received a variant with an - ```rust fn unknown_field(field: &str, expected: &''static [&''static str]) -> Self { /* ... */ } ``` Raised when a `Deserialize` struct type received a field with an - ```rust fn missing_field(field: &''static str) -> Self { /* ... */ } ``` Raised when a `Deserialize` struct type expected to receive a required - ```rust fn duplicate_field(field: &''static str) -> Self { /* ... */ } ``` Raised when a `Deserialize` struct type received more than one of the ##### Implementations This trait is implemented for the following types: - `Error` #### Trait `Expected` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Expected` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Expected` is not satisfied\",)]")` `Expected` represents an explanation of what data a `Visitor` was expecting to receive. This is used as an argument to the `invalid_type`, `invalid_value`, and `invalid_length` methods of the `Error` trait to build error messages. The message should be a noun or noun phrase that completes the sentence "This Visitor expects to receive ...", for example the message could be "an integer between 0 and 64". The message should not be capitalized and should not end with a period. Within the context of a `Visitor` implementation, the `Visitor` itself (`&self`) is an implementation of this trait. ```edition2021 # use serde::de::{self, Unexpected, Visitor}; # use std::fmt; # # struct Example; # # impl<'de> Visitor<'de> for Example { # type Value = (); # # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { # write!(formatter, "definitely not a boolean") # } # fn visit_bool(self, v: bool) -> Result where E: de::Error, { Err(de::Error::invalid_type(Unexpected::Bool(v), &self)) } # } ``` Outside of a `Visitor`, `&"..."` can be used. ```edition2021 # use serde::de::{self, Unexpected}; # # fn example() -> Result<(), E> # where # E: de::Error, # { # let v = true; return Err(de::Error::invalid_type( Unexpected::Bool(v), &"a negative integer", )); # } ``` ```rust pub trait Expected { /* Associated items */ } ``` ##### Required Items ###### Required Methods - `fmt`: Format an explanation of what data was being expected. Same signature as ##### Implementations This trait is implemented for the following types: - `T` with <''de, T> - `&str` #### Trait `Deserialize` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::Deserialize<'de>` is not satisfied\", note =\n\"for local types consider adding `#[derive(serde::Deserialize)]` to your `{Self}` type\",\nnote =\n\"for types from other crates check whether the crate offers a `serde` feature flag\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::Deserialize<'de>` is not satisfied\", note =\n\"for local types consider adding `#[derive(serde::Deserialize)]` to your `{Self}` type\",\nnote =\n\"for types from other crates check whether the crate offers a `serde` feature flag\",)]")` A **data structure** that can be deserialized from any data format supported by Serde. Serde provides `Deserialize` implementations for many Rust primitive and standard library types. The complete list is [here][crate::de]. All of these can be deserialized using Serde out of the box. Additionally, Serde provides a procedural macro called `serde_derive` to automatically generate `Deserialize` implementations for structs and enums in your program. See the [derive section of the manual][derive] for how to use this. In rare cases it may be necessary to implement `Deserialize` manually for some type in your program. See the [Implementing `Deserialize`][impl-deserialize] section of the manual for more about this. Third-party crates may provide `Deserialize` implementations for types that they expose. For example the `linked-hash-map` crate provides a `LinkedHashMap` type that is deserializable by Serde because the crate provides an implementation of `Deserialize` for it. [derive]: https://serde.rs/derive.html [impl-deserialize]: https://serde.rs/impl-deserialize.html # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed by `Self` when deserialized. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html ```rust pub trait Deserialize<''de>: Sized { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Required Methods - `deserialize`: Deserialize this value from the given Serde deserializer. ##### Implementations This trait is implemented for the following types: - `IgnoredAny` with <''de> - `()` with <''de> - `never` with <''de> - `bool` with <''de> - `i8` with <''de> - `num::NonZeroI8` with <''de> - `Saturating` with <''de> - `i16` with <''de> - `num::NonZeroI16` with <''de> - `Saturating` with <''de> - `i32` with <''de> - `num::NonZeroI32` with <''de> - `Saturating` with <''de> - `i64` with <''de> - `num::NonZeroI64` with <''de> - `Saturating` with <''de> - `isize` with <''de> - `num::NonZeroIsize` with <''de> - `Saturating` with <''de> - `u8` with <''de> - `num::NonZeroU8` with <''de> - `Saturating` with <''de> - `u16` with <''de> - `num::NonZeroU16` with <''de> - `Saturating` with <''de> - `u32` with <''de> - `num::NonZeroU32` with <''de> - `Saturating` with <''de> - `u64` with <''de> - `num::NonZeroU64` with <''de> - `Saturating` with <''de> - `usize` with <''de> - `num::NonZeroUsize` with <''de> - `Saturating` with <''de> - `f32` with <''de> - `f64` with <''de> - `i128` with <''de> - `num::NonZeroI128` with <''de> - `Saturating` with <''de> - `u128` with <''de> - `num::NonZeroU128` with <''de> - `Saturating` with <''de> - `char` with <''de> - `String` with <''de> - `&''a str` with <''de: ''a, ''a> - `&''a [u8]` with <''de: ''a, ''a> - `CString` with <''de> - `Box` with <''de> - `Reverse` with <''de, T: Deserialize<''de>> - `Option` with <''de, T> - `PhantomData` with <''de, T> - `BinaryHeap` with <''de, T> - `BTreeSet` with <''de, T> - `LinkedList` with <''de, T> - `HashSet` with <''de, T, S> - `VecDeque` with <''de, T> - `Vec` with <''de, T> - `[T; 0]` with <''de, T> - `[T; 1]` with <''de, T> - `[T; 2]` with <''de, T> - `[T; 3]` with <''de, T> - `[T; 4]` with <''de, T> - `[T; 5]` with <''de, T> - `[T; 6]` with <''de, T> - `[T; 7]` with <''de, T> - `[T; 8]` with <''de, T> - `[T; 9]` with <''de, T> - `[T; 10]` with <''de, T> - `[T; 11]` with <''de, T> - `[T; 12]` with <''de, T> - `[T; 13]` with <''de, T> - `[T; 14]` with <''de, T> - `[T; 15]` with <''de, T> - `[T; 16]` with <''de, T> - `[T; 17]` with <''de, T> - `[T; 18]` with <''de, T> - `[T; 19]` with <''de, T> - `[T; 20]` with <''de, T> - `[T; 21]` with <''de, T> - `[T; 22]` with <''de, T> - `[T; 23]` with <''de, T> - `[T; 24]` with <''de, T> - `[T; 25]` with <''de, T> - `[T; 26]` with <''de, T> - `[T; 27]` with <''de, T> - `[T; 28]` with <''de, T> - `[T; 29]` with <''de, T> - `[T; 30]` with <''de, T> - `[T; 31]` with <''de, T> - `[T; 32]` with <''de, T> - `(T)` with <''de, T> - `BTreeMap` with <''de, K, V> - `HashMap` with <''de, K, V, S> - `net::IpAddr` with <''de> - `net::Ipv4Addr` with <''de> - `net::Ipv6Addr` with <''de> - `net::SocketAddr` with <''de> - `net::SocketAddrV4` with <''de> - `net::SocketAddrV6` with <''de> - `&''a Path` with <''de: ''a, ''a> - `PathBuf` with <''de> - `Box` with <''de> - `OsString` with <''de> - `Box` with <''de, T: Deserialize<''de>> - `Box<[T]>` with <''de, T: Deserialize<''de>> - `Box` with <''de> - `Box` with <''de> - `Cow<''a, T>` with <''de, ''a, T> - `RcWeak` with <''de, T> - `ArcWeak` with <''de, T> - `Rc` with <''de, T> - `Arc` with <''de, T> - `Cell` with <''de, T> - `RefCell` with <''de, T: Deserialize<''de>> - `Mutex` with <''de, T: Deserialize<''de>> - `RwLock` with <''de, T: Deserialize<''de>> - `Duration` with <''de> - `SystemTime` with <''de> - `Range` with <''de, Idx> - `RangeInclusive` with <''de, Idx> - `RangeFrom` with <''de, Idx> - `RangeTo` with <''de, Idx> - `Bound` with <''de, T> - `Wrapping` with <''de, T> - `AtomicBool` with <''de> - `AtomicI8` with <''de> - `AtomicI16` with <''de> - `AtomicI32` with <''de> - `AtomicIsize` with <''de> - `AtomicU8` with <''de> - `AtomicU16` with <''de> - `AtomicU32` with <''de> - `AtomicUsize` with <''de> - `AtomicI64` with <''de> - `AtomicU64` with <''de> #### Trait `DeserializeOwned` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::DeserializeOwned` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::DeserializeOwned` is not satisfied\",)]")` A data structure that can be deserialized without borrowing any data from the deserializer. This is primarily useful for trait bounds on functions. For example a `from_str` function may be able to deserialize a data structure that borrows from the input string, but a `from_reader` function may only deserialize owned data. ```edition2021 # use serde::de::{Deserialize, DeserializeOwned}; # use std::io::{Read, Result}; # # trait Ignore { fn from_str<'a, T>(s: &'a str) -> Result where T: Deserialize<'a>; fn from_reader(rdr: R) -> Result where R: Read, T: DeserializeOwned; # } ``` # Lifetime The relationship between `Deserialize` and `DeserializeOwned` in trait bounds is explained in more detail on the page [Understanding deserializer lifetimes]. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html ```rust pub trait DeserializeOwned: for<''de> Deserialize<''de> { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Implementations This trait is implemented for the following types: - `T` with #### Trait `DeserializeSeed` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::DeserializeSeed<'de>` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::DeserializeSeed<'de>` is not satisfied\",)]")` `DeserializeSeed` is the stateful form of the `Deserialize` trait. If you ever find yourself looking for a way to pass data into a `Deserialize` impl, this trait is the way to do it. As one example of stateful deserialization consider deserializing a JSON array into an existing buffer. Using the `Deserialize` trait we could deserialize a JSON array into a `Vec` but it would be a freshly allocated `Vec`; there is no way for `Deserialize` to reuse a previously allocated buffer. Using `DeserializeSeed` instead makes this possible as in the example code below. The canonical API for stateless deserialization looks like this: ```edition2021 # use serde::Deserialize; # # enum Error {} # fn func<'de, T: Deserialize<'de>>() -> Result # { # unimplemented!() # } ``` Adjusting an API like this to support stateful deserialization is a matter of accepting a seed as input: ```edition2021 # use serde::de::DeserializeSeed; # # enum Error {} # fn func_seed<'de, T: DeserializeSeed<'de>>(seed: T) -> Result # { # let _ = seed; # unimplemented!() # } ``` In practice the majority of deserialization is stateless. An API expecting a seed can be appeased by passing `std::marker::PhantomData` as a seed in the case of stateless deserialization. # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed by `Self::Value` when deserialized. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example Suppose we have JSON that looks like `[[1, 2], [3, 4, 5], [6]]` and we need to deserialize it into a flat representation like `vec![1, 2, 3, 4, 5, 6]`. Allocating a brand new `Vec` for each subarray would be slow. Instead we would like to allocate a single `Vec` and then deserialize each subarray into it. This requires stateful deserialization using the `DeserializeSeed` trait. ```edition2021 use serde::de::{Deserialize, DeserializeSeed, Deserializer, SeqAccess, Visitor}; use std::fmt; use std::marker::PhantomData; // A DeserializeSeed implementation that uses stateful deserialization to // append array elements onto the end of an existing vector. The preexisting // state ("seed") in this case is the Vec. The `deserialize` method of // `ExtendVec` will be traversing the inner arrays of the JSON input and // appending each integer into the existing Vec. struct ExtendVec<'a, T: 'a>(&'a mut Vec); impl<'de, 'a, T> DeserializeSeed<'de> for ExtendVec<'a, T> where T: Deserialize<'de>, { // The return type of the `deserialize` method. This implementation // appends onto an existing vector but does not create any new data // structure, so the return type is (). type Value = (); fn deserialize(self, deserializer: D) -> Result where D: Deserializer<'de>, { // Visitor implementation that will walk an inner array of the JSON // input. struct ExtendVecVisitor<'a, T: 'a>(&'a mut Vec); impl<'de, 'a, T> Visitor<'de> for ExtendVecVisitor<'a, T> where T: Deserialize<'de>, { type Value = (); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { write!(formatter, "an array of integers") } fn visit_seq(self, mut seq: A) -> Result<(), A::Error> where A: SeqAccess<'de>, { // Decrease the number of reallocations if there are many elements if let Some(size_hint) = seq.size_hint() { self.0.reserve(size_hint); } // Visit each element in the inner array and push it onto // the existing vector. while let Some(elem) = seq.next_element()? { self.0.push(elem); } Ok(()) } } deserializer.deserialize_seq(ExtendVecVisitor(self.0)) } } // Visitor implementation that will walk the outer array of the JSON input. struct FlattenedVecVisitor(PhantomData); impl<'de, T> Visitor<'de> for FlattenedVecVisitor where T: Deserialize<'de>, { // This Visitor constructs a single Vec to hold the flattened // contents of the inner arrays. type Value = Vec; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { write!(formatter, "an array of arrays") } fn visit_seq(self, mut seq: A) -> Result, A::Error> where A: SeqAccess<'de>, { // Create a single Vec to hold the flattened contents. let mut vec = Vec::new(); // Each iteration through this loop is one inner array. while let Some(()) = seq.next_element_seed(ExtendVec(&mut vec))? { // Nothing to do; inner array has been appended into `vec`. } // Return the finished vec. Ok(vec) } } # fn example<'de, D>(deserializer: D) -> Result<(), D::Error> # where # D: Deserializer<'de>, # { let visitor = FlattenedVecVisitor(PhantomData); let flattened: Vec = deserializer.deserialize_seq(visitor)?; # Ok(()) # } ``` ```rust pub trait DeserializeSeed<''de>: Sized { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Value`: The type produced by using this seed. ###### Required Methods - `deserialize`: Equivalent to the more common `Deserialize::deserialize` method, except ##### Implementations This trait is implemented for the following types: - `PhantomData` with <''de, T> #### Trait `Deserializer` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Deserializer<'de>` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Deserializer<'de>` is not satisfied\",)]")` A **data format** that can deserialize any data structure supported by Serde. The role of this trait is to define the deserialization half of the [Serde data model], which is a way to categorize every Rust data type into one of 29 possible types. Each method of the `Deserializer` trait corresponds to one of the types of the data model. Implementations of `Deserialize` map themselves into this data model by passing to the `Deserializer` a `Visitor` implementation that can receive these various types. The types that make up the Serde data model are: - **14 primitive types** - bool - i8, i16, i32, i64, i128 - u8, u16, u32, u64, u128 - f32, f64 - char - **string** - UTF-8 bytes with a length and no null terminator. - When serializing, all strings are handled equally. When deserializing, there are three flavors of strings: transient, owned, and borrowed. - **byte array** - \[u8\] - Similar to strings, during deserialization byte arrays can be transient, owned, or borrowed. - **option** - Either none or some value. - **unit** - The type of `()` in Rust. It represents an anonymous value containing no data. - **unit_struct** - For example `struct Unit` or `PhantomData`. It represents a named value containing no data. - **unit_variant** - For example the `E::A` and `E::B` in `enum E { A, B }`. - **newtype_struct** - For example `struct Millimeters(u8)`. - **newtype_variant** - For example the `E::N` in `enum E { N(u8) }`. - **seq** - A variably sized heterogeneous sequence of values, for example `Vec` or `HashSet`. When serializing, the length may or may not be known before iterating through all the data. When deserializing, the length is determined by looking at the serialized data. - **tuple** - A statically sized heterogeneous sequence of values for which the length will be known at deserialization time without looking at the serialized data, for example `(u8,)` or `(String, u64, Vec)` or `[u64; 10]`. - **tuple_struct** - A named tuple, for example `struct Rgb(u8, u8, u8)`. - **tuple_variant** - For example the `E::T` in `enum E { T(u8, u8) }`. - **map** - A heterogeneous key-value pairing, for example `BTreeMap`. - **struct** - A heterogeneous key-value pairing in which the keys are strings and will be known at deserialization time without looking at the serialized data, for example `struct S { r: u8, g: u8, b: u8 }`. - **struct_variant** - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. The `Deserializer` trait supports two entry point styles which enables different kinds of deserialization. 1. The `deserialize_any` method. Self-describing data formats like JSON are able to look at the serialized data and tell what it represents. For example the JSON deserializer may see an opening curly brace (`{`) and know that it is seeing a map. If the data format supports `Deserializer::deserialize_any`, it will drive the Visitor using whatever type it sees in the input. JSON uses this approach when deserializing `serde_json::Value` which is an enum that can represent any JSON document. Without knowing what is in a JSON document, we can deserialize it to `serde_json::Value` by going through `Deserializer::deserialize_any`. 2. The various `deserialize_*` methods. Non-self-describing formats like Postcard need to be told what is in the input in order to deserialize it. The `deserialize_*` methods are hints to the deserializer for how to interpret the next piece of input. Non-self-describing formats are not able to deserialize something like `serde_json::Value` which relies on `Deserializer::deserialize_any`. When implementing `Deserialize`, you should avoid relying on `Deserializer::deserialize_any` unless you need to be told by the Deserializer what type is in the input. Know that relying on `Deserializer::deserialize_any` means your data type will be able to deserialize from self-describing formats only, ruling out Postcard and many others. [Serde data model]: https://serde.rs/data-model.html # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed from the input when deserializing. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example implementation The [example data format] presented on the website contains example code for a basic JSON `Deserializer`. [example data format]: https://serde.rs/data-format.html ```rust pub trait Deserializer<''de>: Sized { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Error`: The error type that can be returned if some error occurs during ###### Required Methods - `deserialize_any`: Require the `Deserializer` to figure out how to drive the visitor based - `deserialize_bool`: Hint that the `Deserialize` type is expecting a `bool` value. - `deserialize_i8`: Hint that the `Deserialize` type is expecting an `i8` value. - `deserialize_i16`: Hint that the `Deserialize` type is expecting an `i16` value. - `deserialize_i32`: Hint that the `Deserialize` type is expecting an `i32` value. - `deserialize_i64`: Hint that the `Deserialize` type is expecting an `i64` value. - `deserialize_u8`: Hint that the `Deserialize` type is expecting a `u8` value. - `deserialize_u16`: Hint that the `Deserialize` type is expecting a `u16` value. - `deserialize_u32`: Hint that the `Deserialize` type is expecting a `u32` value. - `deserialize_u64`: Hint that the `Deserialize` type is expecting a `u64` value. - `deserialize_f32`: Hint that the `Deserialize` type is expecting a `f32` value. - `deserialize_f64`: Hint that the `Deserialize` type is expecting a `f64` value. - `deserialize_char`: Hint that the `Deserialize` type is expecting a `char` value. - `deserialize_str`: Hint that the `Deserialize` type is expecting a string value and does - `deserialize_string`: Hint that the `Deserialize` type is expecting a string value and would - `deserialize_bytes`: Hint that the `Deserialize` type is expecting a byte array and does not - `deserialize_byte_buf`: Hint that the `Deserialize` type is expecting a byte array and would - `deserialize_option`: Hint that the `Deserialize` type is expecting an optional value. - `deserialize_unit`: Hint that the `Deserialize` type is expecting a unit value. - `deserialize_unit_struct`: Hint that the `Deserialize` type is expecting a unit struct with a - `deserialize_newtype_struct`: Hint that the `Deserialize` type is expecting a newtype struct with a - `deserialize_seq`: Hint that the `Deserialize` type is expecting a sequence of values. - `deserialize_tuple`: Hint that the `Deserialize` type is expecting a sequence of values and - `deserialize_tuple_struct`: Hint that the `Deserialize` type is expecting a tuple struct with a - `deserialize_map`: Hint that the `Deserialize` type is expecting a map of key-value pairs. - `deserialize_struct`: Hint that the `Deserialize` type is expecting a struct with a particular - `deserialize_enum`: Hint that the `Deserialize` type is expecting an enum value with a - `deserialize_identifier`: Hint that the `Deserialize` type is expecting the name of a struct - `deserialize_ignored_any`: Hint that the `Deserialize` type needs to deserialize a value whose type ##### Provided Methods - ```rust fn deserialize_i128(self: Self, visitor: V) -> Result<::Value, ::Error> where V: Visitor<''de> { /* ... */ } ``` Hint that the `Deserialize` type is expecting an `i128` value. - ```rust fn deserialize_u128(self: Self, visitor: V) -> Result<::Value, ::Error> where V: Visitor<''de> { /* ... */ } ``` Hint that the `Deserialize` type is expecting an `u128` value. - ```rust fn is_human_readable(self: &Self) -> bool { /* ... */ } ``` Determine whether `Deserialize` implementations should expect to ##### Implementations This trait is implemented for the following types: - `UnitDeserializer` with <''de, E> - `NeverDeserializer` with <''de, E> - `BoolDeserializer` with <''de, E> - `I8Deserializer` with <''de, E> - `I16Deserializer` with <''de, E> - `I32Deserializer` with <''de, E> - `I64Deserializer` with <''de, E> - `I128Deserializer` with <''de, E> - `IsizeDeserializer` with <''de, E> - `U8Deserializer` with <''de, E> - `U16Deserializer` with <''de, E> - `U64Deserializer` with <''de, E> - `U128Deserializer` with <''de, E> - `UsizeDeserializer` with <''de, E> - `F32Deserializer` with <''de, E> - `F64Deserializer` with <''de, E> - `CharDeserializer` with <''de, E> - `U32Deserializer` with <''de, E> - `StrDeserializer<''a, E>` with <''de, ''a, E> - `BorrowedStrDeserializer<''de, E>` with <''de, E> - `StringDeserializer` with <''de, E> - `CowStrDeserializer<''a, E>` with <''de, ''a, E> - `BytesDeserializer<''a, E>` with <''de, ''a, E> - `BorrowedBytesDeserializer<''de, E>` with <''de, E> - `SeqDeserializer` with <''de, I, T, E> - `SeqAccessDeserializer` with <''de, A> - `MapDeserializer<''de, I, E>` with <''de, I, E> - `MapAccessDeserializer` with <''de, A> - `EnumAccessDeserializer` with <''de, A> #### Trait `Visitor` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Visitor<'de>` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::Visitor<'de>` is not satisfied\",)]")` This trait represents a visitor that walks through a deserializer. # Lifetime The `'de` lifetime of this trait is the requirement for lifetime of data that may be borrowed by `Self::Value`. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example ```edition2021 # use serde::de::{self, Unexpected, Visitor}; # use std::fmt; # /// A visitor that deserializes a long string - a string containing at least /// some minimum number of bytes. struct LongString { min: usize, } impl<'de> Visitor<'de> for LongString { type Value = String; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { write!(formatter, "a string containing at least {} bytes", self.min) } fn visit_str(self, s: &str) -> Result where E: de::Error, { if s.len() >= self.min { Ok(s.to_owned()) } else { Err(de::Error::invalid_value(Unexpected::Str(s), &self)) } } } ``` ```rust pub trait Visitor<''de>: Sized { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Value`: The value produced by this visitor. ###### Required Methods - `expecting`: Format a message stating what data this Visitor expects to receive. ##### Provided Methods - ```rust fn visit_bool(self: Self, v: bool) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a boolean. - ```rust fn visit_i8(self: Self, v: i8) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains an `i8`. - ```rust fn visit_i16(self: Self, v: i16) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains an `i16`. - ```rust fn visit_i32(self: Self, v: i32) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains an `i32`. - ```rust fn visit_i64(self: Self, v: i64) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains an `i64`. - ```rust fn visit_i128(self: Self, v: i128) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a `i128`. - ```rust fn visit_u8(self: Self, v: u8) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a `u8`. - ```rust fn visit_u16(self: Self, v: u16) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a `u16`. - ```rust fn visit_u32(self: Self, v: u32) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a `u32`. - ```rust fn visit_u64(self: Self, v: u64) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a `u64`. - ```rust fn visit_u128(self: Self, v: u128) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a `u128`. - ```rust fn visit_f32(self: Self, v: f32) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains an `f32`. - ```rust fn visit_f64(self: Self, v: f64) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains an `f64`. - ```rust fn visit_char(self: Self, v: char) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a `char`. - ```rust fn visit_str(self: Self, v: &str) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a string. The lifetime of the string is ephemeral and - ```rust fn visit_borrowed_str(self: Self, v: &''de str) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a string that lives at least as long as the - ```rust fn visit_string(self: Self, v: String) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a string and ownership of the string is being given - ```rust fn visit_bytes(self: Self, v: &[u8]) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a byte array. The lifetime of the byte array is - ```rust fn visit_borrowed_bytes(self: Self, v: &''de [u8]) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a byte array that lives at least as long as the - ```rust fn visit_byte_buf(self: Self, v: Vec) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a byte array and ownership of the byte array is being - ```rust fn visit_none(self: Self) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains an optional that is absent. - ```rust fn visit_some(self: Self, deserializer: D) -> Result<::Value, ::Error> where D: Deserializer<''de> { /* ... */ } ``` The input contains an optional that is present. - ```rust fn visit_unit(self: Self) -> Result<::Value, E> where E: Error { /* ... */ } ``` The input contains a unit `()`. - ```rust fn visit_newtype_struct(self: Self, deserializer: D) -> Result<::Value, ::Error> where D: Deserializer<''de> { /* ... */ } ``` The input contains a newtype struct. - ```rust fn visit_seq(self: Self, seq: A) -> Result<::Value, ::Error> where A: SeqAccess<''de> { /* ... */ } ``` The input contains a sequence of elements. - ```rust fn visit_map(self: Self, map: A) -> Result<::Value, ::Error> where A: MapAccess<''de> { /* ... */ } ``` The input contains a key-value map. - ```rust fn visit_enum(self: Self, data: A) -> Result<::Value, ::Error> where A: EnumAccess<''de> { /* ... */ } ``` The input contains an enum. ##### Implementations This trait is implemented for the following types: - `IgnoredAny` with <''de> #### Trait `SeqAccess` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::SeqAccess<'de>` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::SeqAccess<'de>` is not satisfied\",)]")` Provides a `Visitor` access to each element of a sequence in the input. This is a trait that a `Deserializer` passes to a `Visitor` implementation, which deserializes each item in a sequence. # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed by deserialized sequence elements. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example implementation The [example data format] presented on the website demonstrates an implementation of `SeqAccess` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SeqAccess<''de> { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Error`: The error type that can be returned if some error occurs during ###### Required Methods - `next_element_seed`: This returns `Ok(Some(value))` for the next value in the sequence, or ##### Provided Methods - ```rust fn next_element(self: &mut Self) -> Result, ::Error> where T: Deserialize<''de> { /* ... */ } ``` This returns `Ok(Some(value))` for the next value in the sequence, or - ```rust fn size_hint(self: &Self) -> Option { /* ... */ } ``` Returns the number of elements remaining in the sequence, if known. ##### Implementations This trait is implemented for the following types: - `SeqDeserializer` with <''de, I, T, E> - `MapDeserializer<''de, I, E>` with <''de, I, E> - `&mut A` with <''de, A> #### Trait `MapAccess` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::MapAccess<'de>` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::MapAccess<'de>` is not satisfied\",)]")` Provides a `Visitor` access to each entry of a map in the input. This is a trait that a `Deserializer` passes to a `Visitor` implementation. # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed by deserialized map entries. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example implementation The [example data format] presented on the website demonstrates an implementation of `MapAccess` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait MapAccess<''de> { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Error`: The error type that can be returned if some error occurs during ###### Required Methods - `next_key_seed`: This returns `Ok(Some(key))` for the next key in the map, or `Ok(None)` - `next_value_seed`: This returns a `Ok(value)` for the next value in the map. ##### Provided Methods - ```rust fn next_entry_seed(self: &mut Self, kseed: K, vseed: V) -> Result::Value, ::Value)>, ::Error> where K: DeserializeSeed<''de>, V: DeserializeSeed<''de> { /* ... */ } ``` This returns `Ok(Some((key, value)))` for the next (key-value) pair in - ```rust fn next_key(self: &mut Self) -> Result, ::Error> where K: Deserialize<''de> { /* ... */ } ``` This returns `Ok(Some(key))` for the next key in the map, or `Ok(None)` - ```rust fn next_value(self: &mut Self) -> Result::Error> where V: Deserialize<''de> { /* ... */ } ``` This returns a `Ok(value)` for the next value in the map. - ```rust fn next_entry(self: &mut Self) -> Result, ::Error> where K: Deserialize<''de>, V: Deserialize<''de> { /* ... */ } ``` This returns `Ok(Some((key, value)))` for the next (key-value) pair in - ```rust fn size_hint(self: &Self) -> Option { /* ... */ } ``` Returns the number of entries remaining in the map, if known. ##### Implementations This trait is implemented for the following types: - `MapDeserializer<''de, I, E>` with <''de, I, E> - `&mut A` with <''de, A> #### Trait `EnumAccess` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::EnumAccess<'de>` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::EnumAccess<'de>` is not satisfied\",)]")` Provides a `Visitor` access to the data of an enum in the input. `EnumAccess` is created by the `Deserializer` and passed to the `Visitor` in order to identify which variant of an enum to deserialize. # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed by the deserialized enum variant. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example implementation The [example data format] presented on the website demonstrates an implementation of `EnumAccess` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait EnumAccess<''de>: Sized { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Error`: The error type that can be returned if some error occurs during - `Variant`: The `Visitor` that will be used to deserialize the content of the enum ###### Required Methods - `variant_seed`: `variant` is called to identify which variant to deserialize. ##### Provided Methods - ```rust fn variant(self: Self) -> Result<(V, ::Variant), ::Error> where V: Deserialize<''de> { /* ... */ } ``` `variant` is called to identify which variant to deserialize. ##### Implementations This trait is implemented for the following types: - `U32Deserializer` with <''de, E> - `StrDeserializer<''a, E>` with <''de, ''a, E> - `BorrowedStrDeserializer<''de, E>` with <''de, E> - `StringDeserializer` with <''de, E> - `CowStrDeserializer<''a, E>` with <''de, ''a, E> - `MapAccessDeserializer` with <''de, A> #### Trait `VariantAccess` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::VariantAccess<'de>` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::de::VariantAccess<'de>` is not satisfied\",)]")` `VariantAccess` is a visitor that is created by the `Deserializer` and passed to the `Deserialize` to deserialize the content of a particular enum variant. # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed by the deserialized enum variant. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example implementation The [example data format] presented on the website demonstrates an implementation of `VariantAccess` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait VariantAccess<''de>: Sized { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Error`: The error type that can be returned if some error occurs during ###### Required Methods - `unit_variant`: Called when deserializing a variant with no values. - `newtype_variant_seed`: Called when deserializing a variant with a single value. - `tuple_variant`: Called when deserializing a tuple-like variant. - `struct_variant`: Called when deserializing a struct-like variant. ##### Provided Methods - ```rust fn newtype_variant(self: Self) -> Result::Error> where T: Deserialize<''de> { /* ... */ } ``` Called when deserializing a variant with a single value. #### Trait `IntoDeserializer` Converts an existing value into a `Deserializer` from which other values can be deserialized. # Lifetime The `'de` lifetime of this trait is the lifetime of data that may be borrowed from the resulting `Deserializer`. See the page [Understanding deserializer lifetimes] for a more detailed explanation of these lifetimes. [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html # Example ```edition2021 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::deserialize(s.into_deserializer()) } } ``` ```rust pub trait IntoDeserializer<''de, E: Error = value::Error> { /* Associated items */ } ``` ##### Required Items ###### Associated Types - `Deserializer`: The type of the deserializer being converted into. ###### Required Methods - `into_deserializer`: Convert this value into a deserializer. ##### Implementations This trait is implemented for the following types: - `()` with <''de, E> - `UnitDeserializer` with <''de, E> - `never` with <''de, E> - `NeverDeserializer` with <''de, E> - `bool` with <''de, E> - `BoolDeserializer` with <''de, E> - `i8` with <''de, E> - `I8Deserializer` with <''de, E> - `i16` with <''de, E> - `I16Deserializer` with <''de, E> - `i32` with <''de, E> - `I32Deserializer` with <''de, E> - `i64` with <''de, E> - `I64Deserializer` with <''de, E> - `i128` with <''de, E> - `I128Deserializer` with <''de, E> - `isize` with <''de, E> - `IsizeDeserializer` with <''de, E> - `u8` with <''de, E> - `U8Deserializer` with <''de, E> - `u16` with <''de, E> - `U16Deserializer` with <''de, E> - `u64` with <''de, E> - `U64Deserializer` with <''de, E> - `u128` with <''de, E> - `U128Deserializer` with <''de, E> - `usize` with <''de, E> - `UsizeDeserializer` with <''de, E> - `f32` with <''de, E> - `F32Deserializer` with <''de, E> - `f64` with <''de, E> - `F64Deserializer` with <''de, E> - `char` with <''de, E> - `CharDeserializer` with <''de, E> - `u32` with <''de, E> - `U32Deserializer` with <''de, E> - `&''a str` with <''de, ''a, E> - `StrDeserializer<''a, E>` with <''de, ''a, E> - `BorrowedStrDeserializer<''de, E>` with <''de, E> - `String` with <''de, E> - `StringDeserializer` with <''de, E> - `Cow<''a, str>` with <''de, ''a, E> - `CowStrDeserializer<''a, E>` with <''de, ''a, E> - `&''a [u8]` with <''de, ''a, E> - `BytesDeserializer<''a, E>` with <''de, ''a, E> - `BorrowedBytesDeserializer<''de, E>` with <''de, E> - `SeqDeserializer` with <''de, I, T, E> - `Vec` with <''de, T, E> - `BTreeSet` with <''de, T, E> - `HashSet` with <''de, T, S, E> - `SeqAccessDeserializer` with <''de, A> - `MapDeserializer<''de, I, E>` with <''de, I, E> - `BTreeMap` with <''de, K, V, E> - `HashMap` with <''de, K, V, S, E> - `MapAccessDeserializer` with <''de, A> - `EnumAccessDeserializer` with <''de, A> ### Re-exports #### Re-export `IgnoredAny` ```rust pub use self::ignored_any::IgnoredAny; ``` #### Re-export `Error` **Attributes:** - `Other("#[(feature = \"std\")]")` - `Other("#[doc(no_inline)]")` ```rust pub use std::error::Error as StdError; ``` ## Module `ser` **Attributes:** - `Other("#[(all(docsrs, if_docsrs_then_no_serde_core), path =\n\"core/ser/mod.rs\")]")` - `Other("#[attr = Path(\"core/ser/mod.rs\")]")` Generic data structure serialization framework. The two most important traits in this module are [`Serialize`] and [`Serializer`]. - **A type that implements `Serialize` is a data structure** that can be serialized to any data format supported by Serde, and conversely - **A type that implements `Serializer` is a data format** that can serialize any data structure supported by Serde. # The Serialize trait Serde provides [`Serialize`] implementations for many Rust primitive and standard library types. The complete list is below. All of these can be serialized using Serde out of the box. Additionally, Serde provides a procedural macro called [`serde_derive`] to automatically generate [`Serialize`] implementations for structs and enums in your program. See the [derive section of the manual] for how to use this. In rare cases it may be necessary to implement [`Serialize`] manually for some type in your program. See the [Implementing `Serialize`] section of the manual for more about this. Third-party crates may provide [`Serialize`] implementations for types that they expose. For example the [`linked-hash-map`] crate provides a [`LinkedHashMap`] type that is serializable by Serde because the crate provides an implementation of [`Serialize`] for it. # The Serializer trait [`Serializer`] implementations are provided by third-party crates, for example [`serde_json`], [`serde_yaml`] and [`postcard`]. A partial list of well-maintained formats is given on the [Serde website][data formats]. # Implementations of Serialize provided by Serde - **Primitive types**: - bool - i8, i16, i32, i64, i128, isize - u8, u16, u32, u64, u128, usize - f32, f64 - char - str - &T and &mut T - **Compound types**: - \[T\] - \[T; 0\] through \[T; 32\] - tuples up to size 16 - **Common standard library types**: - String - Option\ - Result\ - PhantomData\ - **Wrapper types**: - Box\ - Cow\<'a, T\> - Cell\ - RefCell\ - Mutex\ - RwLock\ - Rc\ *(if* features = \["rc"\] *is enabled)* - Arc\ *(if* features = \["rc"\] *is enabled)* - **Collection types**: - BTreeMap\ - BTreeSet\ - BinaryHeap\ - HashMap\ - HashSet\ - LinkedList\ - VecDeque\ - Vec\ - **FFI types**: - CStr - CString - OsStr - OsString - **Miscellaneous standard library types**: - Duration - SystemTime - Path - PathBuf - Range\ - RangeInclusive\ - Bound\ - num::NonZero* - `!` *(unstable)* - **Net types**: - IpAddr - Ipv4Addr - Ipv6Addr - SocketAddr - SocketAddrV4 - SocketAddrV6 [Implementing `Serialize`]: https://serde.rs/impl-serialize.html [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html [`Serialize`]: crate::Serialize [`Serializer`]: crate::Serializer [`postcard`]: https://github.com/jamesmunns/postcard [`linked-hash-map`]: https://crates.io/crates/linked-hash-map [`serde_derive`]: https://crates.io/crates/serde_derive [`serde_json`]: https://github.com/serde-rs/json [`serde_yaml`]: https://github.com/dtolnay/serde-yaml [derive section of the manual]: https://serde.rs/derive.html [data formats]: https://serde.rs/#data-formats ```rust pub mod ser { /* ... */ } ``` ### Traits #### Trait `Error` **Attributes:** - `Other("#[(not(no_diagnostic_namespace), diagnostic ::\non_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::Error` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::Error` is not satisfied\",)]")` Trait used by `Serialize` implementations to generically construct errors belonging to the `Serializer` against which they are currently running. # Example implementation The [example data format] presented on the website shows an error type appropriate for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait Error: Sized + StdError { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Required Methods - `custom`: Used when a [`Serialize`] implementation encounters any error ##### Implementations This trait is implemented for the following types: - `Error` - `fmt::Error` #### Trait `Serialize` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::Serialize` is not satisfied\", note =\n\"for local types consider adding `#[derive(serde::Serialize)]` to your `{Self}` type\",\nnote =\n\"for types from other crates check whether the crate offers a `serde` feature flag\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::Serialize` is not satisfied\", note =\n\"for local types consider adding `#[derive(serde::Serialize)]` to your `{Self}` type\",\nnote =\n\"for types from other crates check whether the crate offers a `serde` feature flag\",)]")` A **data structure** that can be serialized into any data format supported by Serde. Serde provides `Serialize` implementations for many Rust primitive and standard library types. The complete list is [here][crate::ser]. All of these can be serialized using Serde out of the box. Additionally, Serde provides a procedural macro called [`serde_derive`] to automatically generate `Serialize` implementations for structs and enums in your program. See the [derive section of the manual] for how to use this. In rare cases it may be necessary to implement `Serialize` manually for some type in your program. See the [Implementing `Serialize`] section of the manual for more about this. Third-party crates may provide `Serialize` implementations for types that they expose. For example the [`linked-hash-map`] crate provides a [`LinkedHashMap`] type that is serializable by Serde because the crate provides an implementation of `Serialize` for it. [Implementing `Serialize`]: https://serde.rs/impl-serialize.html [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html [`linked-hash-map`]: https://crates.io/crates/linked-hash-map [`serde_derive`]: https://crates.io/crates/serde_derive [derive section of the manual]: https://serde.rs/derive.html ```rust pub trait Serialize { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Required Methods - `serialize`: Serialize this value into the given Serde serializer. ##### Implementations This trait is implemented for the following types: - `bool` - `isize` - `i8` - `i16` - `i32` - `i64` - `i128` - `usize` - `u8` - `u16` - `u32` - `u64` - `u128` - `f32` - `f64` - `char` - `str` - `String` - `fmt::Arguments<''a>` with <''a> - `CStr` - `CString` - `Option` with - `PhantomData` with - `[T; 0]` with - `[T; 1]` with - `[T; 2]` with - `[T; 3]` with - `[T; 4]` with - `[T; 5]` with - `[T; 6]` with - `[T; 7]` with - `[T; 8]` with - `[T; 9]` with - `[T; 10]` with - `[T; 11]` with - `[T; 12]` with - `[T; 13]` with - `[T; 14]` with - `[T; 15]` with - `[T; 16]` with - `[T; 17]` with - `[T; 18]` with - `[T; 19]` with - `[T; 20]` with - `[T; 21]` with - `[T; 22]` with - `[T; 23]` with - `[T; 24]` with - `[T; 25]` with - `[T; 26]` with - `[T; 27]` with - `[T; 28]` with - `[T; 29]` with - `[T; 30]` with - `[T; 31]` with - `[T; 32]` with - `[T]` with - `BinaryHeap` with - `BTreeSet` with - `HashSet` with - `LinkedList` with - `Vec` with - `VecDeque` with - `Range` with - `RangeFrom` with - `RangeInclusive` with - `RangeTo` with - `Bound` with - `()` - `never` - `(T)` with - `BTreeMap` with - `HashMap` with - `&''a T` with <''a, T> - `&''a mut T` with <''a, T> - `Box` with - `Rc` with - `Arc` with - `Cow<''a, T>` with <''a, T> - `RcWeak` with - `ArcWeak` with - `num::NonZeroI8` - `num::NonZeroI16` - `num::NonZeroI32` - `num::NonZeroI64` - `num::NonZeroI128` - `num::NonZeroIsize` - `num::NonZeroU8` - `num::NonZeroU16` - `num::NonZeroU32` - `num::NonZeroU64` - `num::NonZeroU128` - `num::NonZeroUsize` - `Cell` with - `RefCell` with - `Mutex` with - `RwLock` with - `Duration` - `SystemTime` - `net::IpAddr` - `net::Ipv4Addr` - `net::Ipv6Addr` - `net::SocketAddr` - `net::SocketAddrV4` - `net::SocketAddrV6` - `Path` - `PathBuf` - `OsStr` - `OsString` - `Wrapping` with - `Saturating` with - `Reverse` with - `AtomicBool` - `AtomicI8` - `AtomicI16` - `AtomicI32` - `AtomicIsize` - `AtomicU8` - `AtomicU16` - `AtomicU32` - `AtomicUsize` - `AtomicI64` - `AtomicU64` #### Trait `Serializer` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::Serializer` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::Serializer` is not satisfied\",)]")` A **data format** that can serialize any data structure supported by Serde. The role of this trait is to define the serialization half of the [Serde data model], which is a way to categorize every Rust data structure into one of 29 possible types. Each method of the `Serializer` trait corresponds to one of the types of the data model. Implementations of `Serialize` map themselves into this data model by invoking exactly one of the `Serializer` methods. The types that make up the Serde data model are: - **14 primitive types** - bool - i8, i16, i32, i64, i128 - u8, u16, u32, u64, u128 - f32, f64 - char - **string** - UTF-8 bytes with a length and no null terminator. - When serializing, all strings are handled equally. When deserializing, there are three flavors of strings: transient, owned, and borrowed. - **byte array** - \[u8\] - Similar to strings, during deserialization byte arrays can be transient, owned, or borrowed. - **option** - Either none or some value. - **unit** - The type of `()` in Rust. It represents an anonymous value containing no data. - **unit_struct** - For example `struct Unit` or `PhantomData`. It represents a named value containing no data. - **unit_variant** - For example the `E::A` and `E::B` in `enum E { A, B }`. - **newtype_struct** - For example `struct Millimeters(u8)`. - **newtype_variant** - For example the `E::N` in `enum E { N(u8) }`. - **seq** - A variably sized heterogeneous sequence of values, for example `Vec` or `HashSet`. When serializing, the length may or may not be known before iterating through all the data. When deserializing, the length is determined by looking at the serialized data. - **tuple** - A statically sized heterogeneous sequence of values for which the length will be known at deserialization time without looking at the serialized data, for example `(u8,)` or `(String, u64, Vec)` or `[u64; 10]`. - **tuple_struct** - A named tuple, for example `struct Rgb(u8, u8, u8)`. - **tuple_variant** - For example the `E::T` in `enum E { T(u8, u8) }`. - **map** - A heterogeneous key-value pairing, for example `BTreeMap`. - **struct** - A heterogeneous key-value pairing in which the keys are strings and will be known at deserialization time without looking at the serialized data, for example `struct S { r: u8, g: u8, b: u8 }`. - **struct_variant** - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. Many Serde serializers produce text or binary data as output, for example JSON or Postcard. This is not a requirement of the `Serializer` trait, and there are serializers that do not produce text or binary output. One example is the `serde_json::value::Serializer` (distinct from the main `serde_json` serializer) that produces a `serde_json::Value` data structure in memory as output. [Serde data model]: https://serde.rs/data-model.html # Example implementation The [example data format] presented on the website contains example code for a basic JSON `Serializer`. [example data format]: https://serde.rs/data-format.html ```rust pub trait Serializer: Sized { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: The output type produced by this `Serializer` during successful - `Error`: The error type when some error occurs during serialization. - `SerializeSeq`: Type returned from [`serialize_seq`] for serializing the content of the - `SerializeTuple`: Type returned from [`serialize_tuple`] for serializing the content of - `SerializeTupleStruct`: Type returned from [`serialize_tuple_struct`] for serializing the - `SerializeTupleVariant`: Type returned from [`serialize_tuple_variant`] for serializing the - `SerializeMap`: Type returned from [`serialize_map`] for serializing the content of the - `SerializeStruct`: Type returned from [`serialize_struct`] for serializing the content of - `SerializeStructVariant`: Type returned from [`serialize_struct_variant`] for serializing the ###### Required Methods - `serialize_bool`: Serialize a `bool` value. - `serialize_i8`: Serialize an `i8` value. - `serialize_i16`: Serialize an `i16` value. - `serialize_i32`: Serialize an `i32` value. - `serialize_i64`: Serialize an `i64` value. - `serialize_u8`: Serialize a `u8` value. - `serialize_u16`: Serialize a `u16` value. - `serialize_u32`: Serialize a `u32` value. - `serialize_u64`: Serialize a `u64` value. - `serialize_f32`: Serialize an `f32` value. - `serialize_f64`: Serialize an `f64` value. - `serialize_char`: Serialize a character. - `serialize_str`: Serialize a `&str`. - `serialize_bytes`: Serialize a chunk of raw byte data. - `serialize_none`: Serialize a [`None`] value. - `serialize_some`: Serialize a [`Some(T)`] value. - `serialize_unit`: Serialize a `()` value. - `serialize_unit_struct`: Serialize a unit struct like `struct Unit` or `PhantomData`. - `serialize_unit_variant`: Serialize a unit variant like `E::A` in `enum E { A, B }`. - `serialize_newtype_struct`: Serialize a newtype struct like `struct Millimeters(u8)`. - `serialize_newtype_variant`: Serialize a newtype variant like `E::N` in `enum E { N(u8) }`. - `serialize_seq`: Begin to serialize a variably sized sequence. This call must be - `serialize_tuple`: Begin to serialize a statically sized sequence whose length will be - `serialize_tuple_struct`: Begin to serialize a tuple struct like `struct Rgb(u8, u8, u8)`. This - `serialize_tuple_variant`: Begin to serialize a tuple variant like `E::T` in `enum E { T(u8, u8) - `serialize_map`: Begin to serialize a map. This call must be followed by zero or more - `serialize_struct`: Begin to serialize a struct like `struct Rgb { r: u8, g: u8, b: u8 }`. - `serialize_struct_variant`: Begin to serialize a struct variant like `E::S` in `enum E { S { r: u8, ##### Provided Methods - ```rust fn serialize_i128(self: Self, v: i128) -> Result<::Ok, ::Error> { /* ... */ } ``` Serialize an `i128` value. - ```rust fn serialize_u128(self: Self, v: u128) -> Result<::Ok, ::Error> { /* ... */ } ``` Serialize a `u128` value. - ```rust fn collect_seq(self: Self, iter: I) -> Result<::Ok, ::Error> where I: IntoIterator, ::Item: Serialize { /* ... */ } ``` Collect an iterator as a sequence. - ```rust fn collect_map(self: Self, iter: I) -> Result<::Ok, ::Error> where K: Serialize, V: Serialize, I: IntoIterator { /* ... */ } ``` Collect an iterator as a map. - ```rust fn collect_str(self: Self, value: &T) -> Result<::Ok, ::Error> where T: ?Sized + Display { /* ... */ } ``` Serialize a string produced by an implementation of `Display`. - ```rust fn is_human_readable(self: &Self) -> bool { /* ... */ } ``` Determine whether `Serialize` implementations should serialize in ##### Implementations This trait is implemented for the following types: - `&mut fmt::Formatter<''a>` with <''a> #### Trait `SerializeSeq` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeSeq` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeSeq` is not satisfied\",)]")` Returned from `Serializer::serialize_seq`. # Example use ```edition2021 # use std::marker::PhantomData; # # struct Vec(PhantomData); # # impl Vec { # fn len(&self) -> usize { # unimplemented!() # } # } # # impl<'a, T> IntoIterator for &'a Vec { # type Item = &'a T; # type IntoIter = Box>; # fn into_iter(self) -> Self::IntoIter { # unimplemented!() # } # } # use serde::ser::{Serialize, SerializeSeq, Serializer}; impl Serialize for Vec where T: Serialize, { fn serialize(&self, serializer: S) -> Result where S: Serializer, { let mut seq = serializer.serialize_seq(Some(self.len()))?; for element in self { seq.serialize_element(element)?; } seq.end() } } ``` # Example implementation The [example data format] presented on the website demonstrates an implementation of `SerializeSeq` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SerializeSeq { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: Must match the `Ok` type of our `Serializer`. - `Error`: Must match the `Error` type of our `Serializer`. ###### Required Methods - `serialize_element`: Serialize a sequence element. - `end`: Finish serializing a sequence. ##### Implementations This trait is implemented for the following types: - `Impossible` with #### Trait `SerializeTuple` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeTuple` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeTuple` is not satisfied\",)]")` Returned from `Serializer::serialize_tuple`. # Example use ```edition2021 use serde::ser::{Serialize, SerializeTuple, Serializer}; # mod fool { # trait Serialize {} impl Serialize for (A, B, C) # {} # } # # struct Tuple3(A, B, C); # # impl Serialize for Tuple3 where A: Serialize, B: Serialize, C: Serialize, { fn serialize(&self, serializer: S) -> Result where S: Serializer, { let mut tup = serializer.serialize_tuple(3)?; tup.serialize_element(&self.0)?; tup.serialize_element(&self.1)?; tup.serialize_element(&self.2)?; tup.end() } } ``` ```edition2021 # use std::marker::PhantomData; # # struct Array(PhantomData); # # impl Array { # fn len(&self) -> usize { # unimplemented!() # } # } # # impl<'a, T> IntoIterator for &'a Array { # type Item = &'a T; # type IntoIter = Box>; # fn into_iter(self) -> Self::IntoIter { # unimplemented!() # } # } # use serde::ser::{Serialize, SerializeTuple, Serializer}; # mod fool { # trait Serialize {} impl Serialize for [T; 16] # {} # } # # impl Serialize for Array where T: Serialize, { fn serialize(&self, serializer: S) -> Result where S: Serializer, { let mut seq = serializer.serialize_tuple(16)?; for element in self { seq.serialize_element(element)?; } seq.end() } } ``` # Example implementation The [example data format] presented on the website demonstrates an implementation of `SerializeTuple` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SerializeTuple { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: Must match the `Ok` type of our `Serializer`. - `Error`: Must match the `Error` type of our `Serializer`. ###### Required Methods - `serialize_element`: Serialize a tuple element. - `end`: Finish serializing a tuple. ##### Implementations This trait is implemented for the following types: - `Impossible` with #### Trait `SerializeTupleStruct` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeTupleStruct` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeTupleStruct` is not satisfied\",)]")` Returned from `Serializer::serialize_tuple_struct`. # Example use ```edition2021 use serde::ser::{Serialize, SerializeTupleStruct, Serializer}; struct Rgb(u8, u8, u8); impl Serialize for Rgb { fn serialize(&self, serializer: S) -> Result where S: Serializer, { let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; ts.serialize_field(&self.0)?; ts.serialize_field(&self.1)?; ts.serialize_field(&self.2)?; ts.end() } } ``` # Example implementation The [example data format] presented on the website demonstrates an implementation of `SerializeTupleStruct` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SerializeTupleStruct { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: Must match the `Ok` type of our `Serializer`. - `Error`: Must match the `Error` type of our `Serializer`. ###### Required Methods - `serialize_field`: Serialize a tuple struct field. - `end`: Finish serializing a tuple struct. ##### Implementations This trait is implemented for the following types: - `Impossible` with #### Trait `SerializeTupleVariant` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeTupleVariant` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeTupleVariant` is not satisfied\",)]")` Returned from `Serializer::serialize_tuple_variant`. # Example use ```edition2021 use serde::ser::{Serialize, SerializeTupleVariant, Serializer}; enum E { T(u8, u8), U(String, u32, u32), } impl Serialize for E { fn serialize(&self, serializer: S) -> Result where S: Serializer, { match *self { E::T(ref a, ref b) => { let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?; tv.serialize_field(a)?; tv.serialize_field(b)?; tv.end() } E::U(ref a, ref b, ref c) => { let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?; tv.serialize_field(a)?; tv.serialize_field(b)?; tv.serialize_field(c)?; tv.end() } } } } ``` # Example implementation The [example data format] presented on the website demonstrates an implementation of `SerializeTupleVariant` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SerializeTupleVariant { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: Must match the `Ok` type of our `Serializer`. - `Error`: Must match the `Error` type of our `Serializer`. ###### Required Methods - `serialize_field`: Serialize a tuple variant field. - `end`: Finish serializing a tuple variant. ##### Implementations This trait is implemented for the following types: - `Impossible` with #### Trait `SerializeMap` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeMap` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeMap` is not satisfied\",)]")` Returned from `Serializer::serialize_map`. # Example use ```edition2021 # use std::marker::PhantomData; # # struct HashMap(PhantomData, PhantomData); # # impl HashMap { # fn len(&self) -> usize { # unimplemented!() # } # } # # impl<'a, K, V> IntoIterator for &'a HashMap { # type Item = (&'a K, &'a V); # type IntoIter = Box>; # # fn into_iter(self) -> Self::IntoIter { # unimplemented!() # } # } # use serde::ser::{Serialize, SerializeMap, Serializer}; impl Serialize for HashMap where K: Serialize, V: Serialize, { fn serialize(&self, serializer: S) -> Result where S: Serializer, { let mut map = serializer.serialize_map(Some(self.len()))?; for (k, v) in self { map.serialize_entry(k, v)?; } map.end() } } ``` # Example implementation The [example data format] presented on the website demonstrates an implementation of `SerializeMap` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SerializeMap { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: Must match the `Ok` type of our `Serializer`. - `Error`: Must match the `Error` type of our `Serializer`. ###### Required Methods - `serialize_key`: Serialize a map key. - `serialize_value`: Serialize a map value. - `end`: Finish serializing a map. ##### Provided Methods - ```rust fn serialize_entry(self: &mut Self, key: &K, value: &V) -> Result<(), ::Error> where K: ?Sized + Serialize, V: ?Sized + Serialize { /* ... */ } ``` Serialize a map entry consisting of a key and a value. ##### Implementations This trait is implemented for the following types: - `Impossible` with #### Trait `SerializeStruct` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeStruct` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeStruct` is not satisfied\",)]")` Returned from `Serializer::serialize_struct`. # Example use ```edition2021 use serde::ser::{Serialize, SerializeStruct, Serializer}; struct Rgb { r: u8, g: u8, b: u8, } impl Serialize for Rgb { fn serialize(&self, serializer: S) -> Result where S: Serializer, { let mut rgb = serializer.serialize_struct("Rgb", 3)?; rgb.serialize_field("r", &self.r)?; rgb.serialize_field("g", &self.g)?; rgb.serialize_field("b", &self.b)?; rgb.end() } } ``` # Example implementation The [example data format] presented on the website demonstrates an implementation of `SerializeStruct` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SerializeStruct { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: Must match the `Ok` type of our `Serializer`. - `Error`: Must match the `Error` type of our `Serializer`. ###### Required Methods - `serialize_field`: Serialize a struct field. - `end`: Finish serializing a struct. ##### Provided Methods - ```rust fn skip_field(self: &mut Self, key: &''static str) -> Result<(), ::Error> { /* ... */ } ``` Indicate that a struct field has been skipped. ##### Implementations This trait is implemented for the following types: - `Impossible` with #### Trait `SerializeStructVariant` **Attributes:** - `Other("#[(not(no_diagnostic_namespace),\ndiagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeStructVariant` is not satisfied\",))]")` - `Other("#[diagnostic::on_unimplemented(message =\n\"the trait bound `{Self}: serde::ser::SerializeStructVariant` is not satisfied\",)]")` Returned from `Serializer::serialize_struct_variant`. # Example use ```edition2021 use serde::ser::{Serialize, SerializeStructVariant, Serializer}; enum E { S { r: u8, g: u8, b: u8 }, } impl Serialize for E { fn serialize(&self, serializer: S) -> Result where S: Serializer, { match *self { E::S { ref r, ref g, ref b, } => { let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?; sv.serialize_field("r", r)?; sv.serialize_field("g", g)?; sv.serialize_field("b", b)?; sv.end() } } } } ``` # Example implementation The [example data format] presented on the website demonstrates an implementation of `SerializeStructVariant` for a basic JSON data format. [example data format]: https://serde.rs/data-format.html ```rust pub trait SerializeStructVariant { /* Associated items */ } ``` > This trait is not object-safe and cannot be used in dynamic trait objects. ##### Required Items ###### Associated Types - `Ok`: Must match the `Ok` type of our `Serializer`. - `Error`: Must match the `Error` type of our `Serializer`. ###### Required Methods - `serialize_field`: Serialize a struct variant field. - `end`: Finish serializing a struct variant. ##### Provided Methods - ```rust fn skip_field(self: &mut Self, key: &''static str) -> Result<(), ::Error> { /* ... */ } ``` Indicate that a struct variant field has been skipped. ##### Implementations This trait is implemented for the following types: - `Impossible` with ### Re-exports #### Re-export `Impossible` ```rust pub use self::impossible::Impossible; ``` #### Re-export `Error` **Attributes:** - `Other("#[(feature = \"std\")]")` - `Other("#[doc(no_inline)]")` ```rust pub use std::error::Error as StdError; ``` ## Macros ### Macro `forward_to_deserialize_any` **Attributes:** - `MacroExport` Helper macro when implementing the `Deserializer` part of a new data format for Serde. Some [`Deserializer`] implementations for self-describing formats do not care what hint the [`Visitor`] gives them, they just want to blindly call the [`Visitor`] method corresponding to the data they can tell is in the input. This requires repetitive implementations of all the [`Deserializer`] trait methods. ```edition2021 # use serde::forward_to_deserialize_any; # use serde::de::{value, Deserializer, Visitor}; # # struct MyDeserializer; # # impl<'de> Deserializer<'de> for MyDeserializer { # type Error = value::Error; # # fn deserialize_any(self, _: V) -> Result # where # V: Visitor<'de>, # { # unimplemented!() # } # #[inline] fn deserialize_bool(self, visitor: V) -> Result where V: Visitor<'de>, { self.deserialize_any(visitor) } # # forward_to_deserialize_any! { # i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string # bytes byte_buf option unit unit_struct newtype_struct seq tuple # tuple_struct map struct enum identifier ignored_any # } # } ``` The `forward_to_deserialize_any!` macro implements these simple forwarding methods so that they forward directly to [`Deserializer::deserialize_any`]. You can choose which methods to forward. ```edition2021 # use serde::forward_to_deserialize_any; # use serde::de::{value, Deserializer, Visitor}; # # struct MyDeserializer; # impl<'de> Deserializer<'de> for MyDeserializer { # type Error = value::Error; # fn deserialize_any(self, visitor: V) -> Result where V: Visitor<'de>, { /* ... */ # let _ = visitor; # unimplemented!() } forward_to_deserialize_any! { bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string bytes byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct map struct enum identifier ignored_any } } ``` The macro assumes the convention that your `Deserializer` lifetime parameter is called `'de` and that the `Visitor` type parameters on each method are called `V`. A different type parameter and a different lifetime can be specified explicitly if necessary. ```edition2021 # use serde::forward_to_deserialize_any; # use serde::de::{value, Deserializer, Visitor}; # use std::marker::PhantomData; # # struct MyDeserializer(PhantomData); # # impl<'q, V> Deserializer<'q> for MyDeserializer { # type Error = value::Error; # # fn deserialize_any(self, visitor: W) -> Result # where # W: Visitor<'q>, # { # unimplemented!() # } # forward_to_deserialize_any! { > bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string bytes byte_buf option unit unit_struct newtype_struct seq tuple tuple_struct map struct enum identifier ignored_any } # } ``` [`Deserializer`]: crate::Deserializer [`Visitor`]: crate::de::Visitor [`Deserializer::deserialize_any`]: crate::Deserializer::deserialize_any ```rust pub macro_rules! forward_to_deserialize_any { /* macro_rules! forward_to_deserialize_any { (<$visitor:ident: Visitor<$lifetime:tt>> $($func:ident)*) => { ... }; ($($func:ident)*) => { ... }; } */ } ``` ## Re-exports ### Re-export `Deserialize` **Attributes:** - `Other("#[doc(inline)]")` ```rust pub use crate::de::Deserialize; ``` ### Re-export `Deserializer` **Attributes:** - `Other("#[doc(inline)]")` ```rust pub use crate::de::Deserializer; ``` ### Re-export `Serialize` **Attributes:** - `Other("#[doc(inline)]")` ```rust pub use crate::ser::Serialize; ``` ### Re-export `Serializer` **Attributes:** - `Other("#[doc(inline)]")` ```rust pub use crate::ser::Serializer; ``` ### Re-export `Deserialize` **Attributes:** - `Other("#[(feature = \"serde_derive\")]")` - `Other("#[(docsrs, doc(cfg(feature = \"derive\")))]")` - `Other("#[doc(cfg(feature = \"derive\"))]")` Derive macro available if serde is built with `features = ["derive"]`. ```rust pub use serde_derive::Deserialize; ``` ### Re-export `Serialize` **Attributes:** - `Other("#[(feature = \"serde_derive\")]")` - `Other("#[(docsrs, doc(cfg(feature = \"derive\")))]")` - `Other("#[doc(cfg(feature = \"derive\"))]")` Derive macro available if serde is built with `features = ["derive"]`. ```rust pub use serde_derive::Serialize; ```