Trait identity_iota::core::FromJson
source · pub trait FromJson: for<'de> Deserialize<'de> + Sized {
// Provided methods
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error> { ... }
fn from_json_slice(
json: &(impl AsRef<[u8]> + ?Sized)
) -> Result<Self, Error> { ... }
fn from_json_value(json: Value) -> Result<Self, Error> { ... }
}
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, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Deserialize Self
from a string of JSON text.
sourcefn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Deserialize Self
from bytes of JSON text.
sourcefn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Deserialize Self
from a serde_json::Value
.
Object Safety§
This trait is not object safe.