Skip to main content

TryFromJson

Trait TryFromJson 

Source
pub trait TryFromJson: Sized {
    type Error;

    // Required method
    fn try_from_json(value: &Value) -> Result<Self, Self::Error>;
}
Expand description

Values that can be built from a JSON value.

Required Associated Types§

Source

type Error

Error raised when the JSON value does not describe a valid Self.

Required Methods§

Source

fn try_from_json(value: &Value) -> Result<Self, Self::Error>

Builds a value of this type from the given JSON value.

§Errors

Returns an error when the JSON value does not describe a valid value of this type.

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 TryFromJson for IriRefBuf

Source§

impl TryFromJson for bool

Implementors§