Skip to main content

ToJsonValue

Trait ToJsonValue 

Source
pub trait ToJsonValue {
    // Required method
    fn to_json_value(&self) -> Value;
}
Expand description

将类型转换为 serde_json::Value 的 trait

Required Methods§

Source

fn to_json_value(&self) -> Value

将自身转换为 serde_json::Value

Implementations on Foreign Types§

Source§

impl ToJsonValue for &str

Source§

impl ToJsonValue for bool

Source§

impl ToJsonValue for f64

Source§

impl ToJsonValue for i32

Source§

impl ToJsonValue for i64

Source§

impl ToJsonValue for usize

Source§

impl ToJsonValue for String

Source§

impl ToJsonValue for PathBuf

Source§

impl<K: ToJsonValue, V: ToJsonValue> ToJsonValue for HashMap<K, V>

Source§

impl<T: ToJsonValue> ToJsonValue for Option<T>

Source§

impl<T: ToJsonValue> ToJsonValue for Vec<T>

Implementors§