Trait identity_core::convert::FromJson
source · pub trait FromJson: for<'de> Deserialize<'de> + Sized {
// Provided methods
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self> { ... }
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self> { ... }
fn from_json_value(json: Value) -> Result<Self> { ... }
}
Expand description
A convenience-trait for types that can be deserialized from JSON.
Provided Methods§
sourcefn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self>
Deserialize Self
from a string of JSON text.
sourcefn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self>
Deserialize Self
from bytes of JSON text.
sourcefn from_json_value(json: Value) -> Result<Self>
fn from_json_value(json: Value) -> Result<Self>
Deserialize Self
from a serde_json::Value
.
Object Safety§
This trait is not object safe.