Struct serializers::Builder [−][src]
pub struct Builder { /* fields omitted */ }
The struct responsible for gathering keys and values for the JSON.
This is the struct you interact with through the
serialize_into
method on the
Serializer
trait.
Methods
impl Builder
[src]
impl Builder
pub fn attr<K, V>(&mut self, key: K, value: &V) -> &mut Self where
K: Into<String>,
V: Serialize,
[src]
pub fn attr<K, V>(&mut self, key: K, value: &V) -> &mut Self where
K: Into<String>,
V: Serialize,
Add a single key-value pair to the JSON.
pub fn has_one<K, V, S>(
&mut self,
key: K,
value: &V,
serializer: &S
) -> &mut Self where
K: Into<String>,
S: Serializer<V>,
[src]
pub fn has_one<K, V, S>(
&mut self,
key: K,
value: &V,
serializer: &S
) -> &mut Self where
K: Into<String>,
S: Serializer<V>,
Add an object to the JSON. The associated value will be serialized using the given serializer.
pub fn has_many<'a, K, V: 'a, S, I>(
&mut self,
key: K,
values: I,
serializer: &S
) -> &mut Self where
K: Into<String>,
S: Serializer<V>,
I: IntoIterator<Item = &'a V>,
[src]
pub fn has_many<'a, K, V: 'a, S, I>(
&mut self,
key: K,
values: I,
serializer: &S
) -> &mut Self where
K: Into<String>,
S: Serializer<V>,
I: IntoIterator<Item = &'a V>,
Add an array to the JSON. Each item in the iterable will be serialized using the given serializer.