pub trait JsonSerialize {
// Required method
fn serialize(&self) -> impl Iterator<Item = char>;
}Expand description
An item which can be serialized as JSON.
Required Methods§
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.
Implementations on Foreign Types§
Source§impl JsonSerialize for ()
Serialize () as null.
impl JsonSerialize for ()
Serialize () as null.
Source§impl JsonSerialize for String
Available on crate feature alloc only.
impl JsonSerialize for String
Available on crate feature
alloc only.Source§impl<K: AsRef<str>, T: 'static + JsonSerialize> JsonSerialize for BTreeMap<K, T>
Available on crate feature alloc only.
impl<K: AsRef<str>, T: 'static + JsonSerialize> JsonSerialize for BTreeMap<K, T>
Available on crate feature
alloc only.Source§impl<K: AsRef<str>, T: 'static + JsonSerialize> JsonSerialize for HashMap<K, T>
Available on crate features alloc and std only.
impl<K: AsRef<str>, T: 'static + JsonSerialize> JsonSerialize for HashMap<K, T>
Available on crate features
alloc and std only.Source§impl<T: JsonSerialize> JsonSerialize for Option<T>
impl<T: JsonSerialize> JsonSerialize for Option<T>
Source§impl<T: JsonSerialize> JsonSerialize for [T]
impl<T: JsonSerialize> JsonSerialize for [T]
Source§impl<T: JsonSerialize> JsonSerialize for Vec<T>
Available on crate feature alloc only.
impl<T: JsonSerialize> JsonSerialize for Vec<T>
Available on crate feature
alloc only.Source§impl<T: JsonSerialize, const N: usize> JsonSerialize for [T; N]
impl<T: JsonSerialize, const N: usize> JsonSerialize for [T; N]
Implementors§
impl JsonSerialize for JsonF64
Available on crate feature
ryu only.