pub trait ToJsonValue<V>where
V: JsonValue,{
// Required method
fn to_json_value(&self) -> V;
}Available on crate feature
expandable only.Expand description
Convert a leaf field value to the chosen JsonValue backend.
Generated code calls this for fields that should land in a {"@value": ...}
object (i.e. anything not marked nested / coerce / container).
Required Methods§
Sourcefn to_json_value(&self) -> V
fn to_json_value(&self) -> V
Converts this value into the chosen JSON backend V.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<V, K, T, S> ToJsonValue<V> for HashMap<K, T, S>
impl<V, K, T, S> ToJsonValue<V> for HashMap<K, T, S>
fn to_json_value(&self) -> V
Source§impl<V, K, T> ToJsonValue<V> for BTreeMap<K, T>
impl<V, K, T> ToJsonValue<V> for BTreeMap<K, T>
fn to_json_value(&self) -> V
Source§impl<V, T> ToJsonValue<V> for &T
impl<V, T> ToJsonValue<V> for &T
fn to_json_value(&self) -> V
Source§impl<V, T> ToJsonValue<V> for Option<T>where
V: JsonValue,
T: ToJsonValue<V>,
impl<V, T> ToJsonValue<V> for Option<T>where
V: JsonValue,
T: ToJsonValue<V>,
fn to_json_value(&self) -> V
Source§impl<V, T> ToJsonValue<V> for Vec<T>where
V: JsonValue,
T: ToJsonValue<V>,
impl<V, T> ToJsonValue<V> for Vec<T>where
V: JsonValue,
T: ToJsonValue<V>,
fn to_json_value(&self) -> V
Source§impl<V, T> ToJsonValue<V> for [T]where
V: JsonValue,
T: ToJsonValue<V>,
impl<V, T> ToJsonValue<V> for [T]where
V: JsonValue,
T: ToJsonValue<V>,
fn to_json_value(&self) -> V
Source§impl<V, Tz> ToJsonValue<V> for DateTime<Tz>
impl<V, Tz> ToJsonValue<V> for DateTime<Tz>
fn to_json_value(&self) -> V
Source§impl<V> ToJsonValue<V> for NaiveDatewhere
V: JsonValue,
impl<V> ToJsonValue<V> for NaiveDatewhere
V: JsonValue,
fn to_json_value(&self) -> V
Source§impl<V> ToJsonValue<V> for NaiveDateTimewhere
V: JsonValue,
impl<V> ToJsonValue<V> for NaiveDateTimewhere
V: JsonValue,
fn to_json_value(&self) -> V
Source§impl<V> ToJsonValue<V> for NaiveTimewhere
V: JsonValue,
impl<V> ToJsonValue<V> for NaiveTimewhere
V: JsonValue,
fn to_json_value(&self) -> V
Source§impl<V> ToJsonValue<V> for Stringwhere
V: JsonValue,
impl<V> ToJsonValue<V> for Stringwhere
V: JsonValue,
fn to_json_value(&self) -> V
Source§impl<V> ToJsonValue<V> for Valuewhere
V: JsonValue,
Recursively translate a serde_json::Value into the chosen JsonValue
backend. Lets fields whose type is serde_json::Value participate in
generic expansion without forcing the backend to be serde_json.
impl<V> ToJsonValue<V> for Valuewhere
V: JsonValue,
Recursively translate a serde_json::Value into the chosen JsonValue
backend. Lets fields whose type is serde_json::Value participate in
generic expansion without forcing the backend to be serde_json.