Trait tusk_rs::json::ToJson

source ·
pub trait ToJson {
    // Required method
    fn to_json(&self) -> String;
}
Expand description

ToJson is a trait that allows any conforming structs to convert to a JSON format.

A default implemenation is most easily obtained by deriving this trait.

Required Methods§

source

fn to_json(&self) -> String

ToJson creates a JSON string from anything which implements it

Implementations on Foreign Types§

source§

impl ToJson for bool

source§

fn to_json(&self) -> String

source§

impl ToJson for f32

source§

fn to_json(&self) -> String

source§

impl ToJson for f64

source§

fn to_json(&self) -> String

source§

impl ToJson for i32

source§

fn to_json(&self) -> String

source§

impl ToJson for i64

source§

fn to_json(&self) -> String

source§

impl ToJson for str

source§

fn to_json(&self) -> String

source§

impl ToJson for u32

source§

fn to_json(&self) -> String

source§

impl ToJson for u64

source§

fn to_json(&self) -> String

source§

impl ToJson for String

source§

fn to_json(&self) -> String

source§

impl ToJson for DateTime<Utc>

source§

fn to_json(&self) -> String

source§

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

source§

fn to_json(&self) -> String

source§

impl<T: ToJson> ToJson for Option<T>

source§

fn to_json(&self) -> String

source§

impl<T: ToJson> ToJson for Vec<T>

source§

fn to_json(&self) -> String

Implementors§