Trait serializers::ToJson[][src]

pub trait ToJson<'a, T: 'a> {
    fn to_value(&self, value: &T) -> Value;

    fn serialize(&self, value: &T) -> String { ... }
fn serialize_iter<I>(&self, values: I) -> String
    where
        I: IntoIterator<Item = &'a T>
, { ... } }

The trait responsible for actually compiling the JSON.

You shouldn't have to implement this trait manually. It will be automatically implemented for anything that implements Serializer.

Required Methods

Turn the given object into a serde_json::Value.

Provided Methods

Turn the given object into JSON.

Turn the given iterable into JSON array. The main usecase for this is to turn Vecs into JSON arrays.

Implementors