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§
Sourceconst IS_CONDITIONAL: bool = true
const IS_CONDITIONAL: bool = true
Whether the implementation returns Some or None conditionally.
Required Methods§
Sourcefn deserialize<D>(deserializer: D) -> Result<Option<Self>, D::Error>where
D: Deserializer<'de>,
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.
impl<'de, T> Deserialize<'de> for Box<[T]>where
T: Deserialize<'de>,
Available on crate feature
alloc only.const IS_CONDITIONAL: bool = alloc::vec::Vec<T>::IS_CONDITIONAL
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.
impl<'de, T> Deserialize<'de> for Vec<T>where
T: Deserialize<'de>,
Available on crate feature
alloc only.