[][src]Struct serde_hjson::ser::Serializer

pub struct Serializer<W, F> { /* fields omitted */ }

A structure for serializing Rust values into Hjson.

Methods

impl<'a, W> Serializer<W, HjsonFormatter<'a>> where
    W: Write
[src]

Creates a new Hjson serializer.

impl<W, F> Serializer<W, F> where
    W: Write,
    F: Formatter
[src]

Creates a new Hjson visitor whose output will be written to the writer specified.

Unwrap the Writer from the Serializer.

Trait Implementations

impl<W, F> Serializer for Serializer<W, F> where
    W: Write,
    F: Formatter
[src]

The error type that can be returned if some error occurs during serialization.

A state object that is initialized by serialize_seq, passed to serialize_seq_elt, and consumed by serialize_seq_end. Use () if no state is required. Read more

A state object that is initialized by serialize_tuple, passed to serialize_tuple_elt, and consumed by serialize_tuple_end. Use () if no state is required. Read more

A state object that is initialized by serialize_tuple_struct, passed to serialize_tuple_struct_elt, and consumed by serialize_tuple_struct_end. Use () if no state is required. Read more

A state object that is initialized by serialize_tuple_variant, passed to serialize_tuple_variant_elt, and consumed by serialize_tuple_variant_end. Use () if no state is required. Read more

A state object that is initialized by serialize_map, passed to serialize_map_elt, and consumed by serialize_map_end. Use () if no state is required. Read more

A state object that is initialized by serialize_struct, passed to serialize_struct_elt, and consumed by serialize_struct_end. Use () if no state is required. Read more

A state object that is initialized by serialize_struct_variant, passed to serialize_struct_variant_elt, and consumed by serialize_struct_variant_end. Use () if no state is required. Read more

Serializes a bool value.

Serializes an isize value. If the format does not differentiate between isize and i64, a reasonable implementation would be to cast the value to i64 and forward to serialize_i64. Read more

Serializes an i8 value. If the format does not differentiate between i8 and i64, a reasonable implementation would be to cast the value to i64 and forward to serialize_i64. Read more

Serializes an i16 value. If the format does not differentiate between i16 and i64, a reasonable implementation would be to cast the value to i64 and forward to serialize_i64. Read more

Serializes an i32 value. If the format does not differentiate between i32 and i64, a reasonable implementation would be to cast the value to i64 and forward to serialize_i64. Read more

Serializes an i64 value.

Serializes a usize value. If the format does not differentiate between usize and u64, a reasonable implementation would be to cast the value to u64 and forward to serialize_u64. Read more

Serializes a u8 value. If the format does not differentiate between u8 and u64, a reasonable implementation would be to cast the value to u64 and forward to serialize_u64. Read more

Serializes a u16 value. If the format does not differentiate between u16 and u64, a reasonable implementation would be to cast the value to u64 and forward to serialize_u64. Read more

Serializes a u32 value. If the format does not differentiate between u32 and u64, a reasonable implementation would be to cast the value to u64 and forward to serialize_u64. Read more

Serializes au64` value.

Serializes an f32 value. If the format does not differentiate between f32 and f64, a reasonable implementation would be to cast the value to f64 and forward to serialize_f64. Read more

Serializes an f64 value.

Serializes a character. If the format does not support characters, it is reasonable to serialize it as a single element str or a u32. Read more

Serializes a &str.

Enables serializers to serialize byte slices more compactly or more efficiently than other types of slices. If no efficient implementation is available, a reasonable implementation would be to forward to serialize_seq. If forwarded, the implementation looks usually just like this: rust let mut state = try!(self.serialize_seq(value)); for b in value { try!(self.serialize_seq_elt(&mut state, b)); } self.serialize_seq_end(state) Read more

Serializes a () value. It's reasonable to just not serialize anything.

Serializes a unit struct value. A reasonable implementation would be to forward to serialize_unit. Read more

Serializes a unit variant, otherwise known as a variant with no arguments. A reasonable implementation would be to forward to serialize_unit. Read more

Serialize newtypes without an object wrapper.

Allows a variant with a single item to be more efficiently serialized than a variant with multiple items. A reasonable implementation would be to forward to serialize_tuple_variant. Read more

Serializes a None value.

Serializes a Some(...) value.

Begins to serialize a sequence. This call must be followed by zero or more calls to serialize_seq_elt, then a call to serialize_seq_end. Read more

Serializes a sequence element. Must have previously called serialize_seq. Read more

Finishes serializing a sequence.

Begins to serialize a sequence whose length will be known at deserialization time. This call must be followed by zero or more calls to serialize_seq_elt, then a call to serialize_seq_end. A reasonable implementation would be to forward to serialize_seq. Read more

Begins to serialize a tuple. This call must be followed by zero or more calls to serialize_tuple_elt, then a call to serialize_tuple_end. A reasonable implementation would be to forward to serialize_seq. Read more

Serializes a tuple element. Must have previously called serialize_tuple. Read more

Finishes serializing a tuple.

Begins to serialize a tuple struct. This call must be followed by zero or more calls to serialize_tuple_struct_elt, then a call to serialize_tuple_struct_end. A reasonable implementation would be to forward to serialize_tuple. Read more

Serializes a tuple struct element. Must have previously called serialize_tuple_struct. Read more

Finishes serializing a tuple struct.

Begins to serialize a tuple variant. This call must be followed by zero or more calls to serialize_tuple_variant_elt, then a call to serialize_tuple_variant_end. A reasonable implementation would be to forward to serialize_tuple_struct. Read more

Serializes a tuple variant element. Must have previously called serialize_tuple_variant. Read more

Finishes serializing a tuple variant.

Begins to serialize a map. This call must be followed by zero or more calls to serialize_map_key and serialize_map_value, then a call to serialize_map_end. Read more

Serialize a map key. Must have previously called serialize_map.

Serialize a map value. Must have previously called serialize_map.

Finishes serializing a map.

Begins to serialize a struct. This call must be followed by zero or more calls to serialize_struct_elt, then a call to serialize_struct_end. Read more

Serializes a struct field. Must have previously called serialize_struct. Read more

Finishes serializing a struct.

Begins to serialize a struct variant. This call must be followed by zero or more calls to serialize_struct_variant_elt, then a call to serialize_struct_variant_end. Read more

Serialize a struct variant element. Must have previously called serialize_struct_variant. Read more

Finishes serializing a struct variant.

Auto Trait Implementations

impl<W, F> Send for Serializer<W, F> where
    F: Send,
    W: Send

impl<W, F> Sync for Serializer<W, F> where
    F: Sync,
    W: Sync

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.