pub trait JsonEncode {
// Required method
fn to_json_value(&self) -> JsonValue;
}Expand description
A type that can be encoded into a JsonValue.
Pair with to_json_string for the canonical compact text, or with
JsonDecode to round-trip. The derive in
reliakit-derive generates implementations of this trait.
Required Methods§
Sourcefn to_json_value(&self) -> JsonValue
fn to_json_value(&self) -> JsonValue
Encodes self into a JsonValue.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".