pub trait ValueAndTypeJsonExtensions: Sized {
// Required methods
fn parse_with_type(
json_val: &JsonValue,
typ: &AnalysedType,
) -> Result<Self, Vec<String>>;
fn to_json_value(&self) -> Result<JsonValue, String>;
}Required Methods§
Sourcefn parse_with_type(
json_val: &JsonValue,
typ: &AnalysedType,
) -> Result<Self, Vec<String>>
fn parse_with_type( json_val: &JsonValue, typ: &AnalysedType, ) -> Result<Self, Vec<String>>
Parses a JSON value representation (with no type information) into a typed value based on the given type information.
Sourcefn to_json_value(&self) -> Result<JsonValue, String>
fn to_json_value(&self) -> Result<JsonValue, String>
Converts a type annotated value to a JSON value representation with no type information.
Use ValueAndType’s Serialize instance with serde_json to get a self-describing
representation that contains both the type information and the value.
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.