pub trait ParseFromJSON: Sized + Type {
// Required method
fn parse_from_json(value: Option<Value>) -> ParseResult<Self>;
// Provided method
fn parse_from_json_string(s: &str) -> ParseResult<Self> { ... }
}
Expand description
Represents a type that can parsing from JSON.
Required Methods§
Sourcefn parse_from_json(value: Option<Value>) -> ParseResult<Self>
fn parse_from_json(value: Option<Value>) -> ParseResult<Self>
Parse from serde_json::Value
.
Provided Methods§
Sourcefn parse_from_json_string(s: &str) -> ParseResult<Self>
fn parse_from_json_string(s: &str) -> ParseResult<Self>
Parse from JSON string.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.