Skip to main content

Deserialize

Trait Deserialize 

Source
pub trait Deserialize<'de>: Sized {
    const IS_CONDITIONAL: bool = true;

    // Required method
    fn deserialize<D>(deserializer: D) -> Result<Option<Self>, D::Error>
       where D: Deserializer<'de>;
}
Expand description

A type that can be deserialized from a Deserializer.

Provided Associated Constants§

Source

const IS_CONDITIONAL: bool = true

Whether the implementation returns Some or None conditionally.

Required Methods§

Source

fn deserialize<D>(deserializer: D) -> Result<Option<Self>, D::Error>
where D: Deserializer<'de>,

Deserializes elements from the given deserializer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'de, T> Deserialize<'de> for Box<[T]>
where T: Deserialize<'de>,

Available on crate feature alloc only.
Source§

const IS_CONDITIONAL: bool = alloc::vec::Vec<T>::IS_CONDITIONAL

Source§

fn deserialize<D>(deserializer: D) -> Result<Option<Self>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de, T> Deserialize<'de> for Vec<T>
where T: Deserialize<'de>,

Available on crate feature alloc only.
Source§

const IS_CONDITIONAL: bool = false

Source§

fn deserialize<D>(deserializer: D) -> Result<Option<Self>, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de> Deserialize<'de> for ()

Source§

const IS_CONDITIONAL: bool = false

Source§

fn deserialize<D>(deserializer: D) -> Result<Option<Self>, D::Error>
where D: Deserializer<'de>,

Implementors§