[−][src]Struct serde_hjson::ser::Serializer
A structure for serializing Rust values into Hjson.
Implementations
impl<'a, W> Serializer<W, HjsonFormatter<'a>> where
W: Write,
[src]
W: Write,
impl<W, F> Serializer<W, F> where
W: Write,
F: Formatter,
[src]
W: Write,
F: Formatter,
pub fn with_formatter(writer: W, formatter: F) -> Self
[src]
Creates a new Hjson visitor whose output will be written to the writer specified.
pub fn into_inner(self) -> W
[src]
Unwrap the Writer
from the Serializer
.
Trait Implementations
impl<W, F> Serializer for Serializer<W, F> where
W: Write,
F: Formatter,
[src]
W: Write,
F: Formatter,
type Error = Error
The error type that can be returned if some error occurs during serialization.
type SeqState = State
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
type TupleState = State
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
type TupleStructState = State
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
type TupleVariantState = State
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
type MapState = State
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
type StructState = State
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
type StructVariantState = State
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
fn serialize_bool(&mut self, value: bool) -> Result<()>
[src]
fn serialize_isize(&mut self, value: isize) -> Result<()>
[src]
fn serialize_i8(&mut self, value: i8) -> Result<()>
[src]
fn serialize_i16(&mut self, value: i16) -> Result<()>
[src]
fn serialize_i32(&mut self, value: i32) -> Result<()>
[src]
fn serialize_i64(&mut self, value: i64) -> Result<()>
[src]
fn serialize_usize(&mut self, value: usize) -> Result<()>
[src]
fn serialize_u8(&mut self, value: u8) -> Result<()>
[src]
fn serialize_u16(&mut self, value: u16) -> Result<()>
[src]
fn serialize_u32(&mut self, value: u32) -> Result<()>
[src]
fn serialize_u64(&mut self, value: u64) -> Result<()>
[src]
fn serialize_f32(&mut self, value: f32) -> Result<()>
[src]
fn serialize_f64(&mut self, value: f64) -> Result<()>
[src]
fn serialize_char(&mut self, value: char) -> Result<()>
[src]
fn serialize_str(&mut self, value: &str) -> Result<()>
[src]
fn serialize_bytes(&mut self, value: &[u8]) -> Result<()>
[src]
fn serialize_unit(&mut self) -> Result<()>
[src]
fn serialize_unit_struct(&mut self, _name: &'static str) -> Result<()>
[src]
fn serialize_unit_variant(
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str
) -> Result<()>
[src]
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str
) -> Result<()>
fn serialize_newtype_struct<T>(
&mut self,
_name: &'static str,
value: T
) -> Result<()> where
T: Serialize,
[src]
&mut self,
_name: &'static str,
value: T
) -> Result<()> where
T: Serialize,
Serialize newtypes without an object wrapper.
fn serialize_newtype_variant<T>(
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str,
value: T
) -> Result<()> where
T: Serialize,
[src]
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str,
value: T
) -> Result<()> where
T: Serialize,
fn serialize_none(&mut self) -> Result<()>
[src]
fn serialize_some<V>(&mut self, value: V) -> Result<()> where
V: Serialize,
[src]
V: Serialize,
fn serialize_seq(&mut self, len: Option<usize>) -> Result<State>
[src]
fn serialize_seq_elt<T: Serialize>(
&mut self,
state: &mut State,
value: T
) -> Result<()> where
T: Serialize,
[src]
&mut self,
state: &mut State,
value: T
) -> Result<()> where
T: Serialize,
fn serialize_seq_end(&mut self, state: State) -> Result<()>
[src]
fn serialize_seq_fixed_size(&mut self, size: usize) -> Result<State>
[src]
fn serialize_tuple(&mut self, len: usize) -> Result<State>
[src]
fn serialize_tuple_elt<T: Serialize>(
&mut self,
state: &mut State,
value: T
) -> Result<()>
[src]
&mut self,
state: &mut State,
value: T
) -> Result<()>
fn serialize_tuple_end(&mut self, state: State) -> Result<()>
[src]
fn serialize_tuple_struct(
&mut self,
_name: &'static str,
len: usize
) -> Result<State>
[src]
&mut self,
_name: &'static str,
len: usize
) -> Result<State>
fn serialize_tuple_struct_elt<T: Serialize>(
&mut self,
state: &mut State,
value: T
) -> Result<()>
[src]
&mut self,
state: &mut State,
value: T
) -> Result<()>
fn serialize_tuple_struct_end(&mut self, state: State) -> Result<()>
[src]
fn serialize_tuple_variant(
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str,
len: usize
) -> Result<State>
[src]
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str,
len: usize
) -> Result<State>
fn serialize_tuple_variant_elt<T: Serialize>(
&mut self,
state: &mut State,
value: T
) -> Result<()>
[src]
&mut self,
state: &mut State,
value: T
) -> Result<()>
fn serialize_tuple_variant_end(&mut self, state: State) -> Result<()>
[src]
fn serialize_map(&mut self, len: Option<usize>) -> Result<State>
[src]
fn serialize_map_key<T: Serialize>(
&mut self,
state: &mut State,
key: T
) -> Result<()>
[src]
&mut self,
state: &mut State,
key: T
) -> Result<()>
fn serialize_map_value<T: Serialize>(
&mut self,
_: &mut State,
value: T
) -> Result<()>
[src]
&mut self,
_: &mut State,
value: T
) -> Result<()>
fn serialize_map_end(&mut self, state: State) -> Result<()>
[src]
fn serialize_struct(&mut self, _name: &'static str, len: usize) -> Result<State>
[src]
fn serialize_struct_elt<V: Serialize>(
&mut self,
state: &mut State,
key: &'static str,
value: V
) -> Result<()>
[src]
&mut self,
state: &mut State,
key: &'static str,
value: V
) -> Result<()>
fn serialize_struct_end(&mut self, state: State) -> Result<()>
[src]
fn serialize_struct_variant(
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str,
len: usize
) -> Result<State>
[src]
&mut self,
_name: &'static str,
_variant_index: usize,
variant: &'static str,
len: usize
) -> Result<State>
fn serialize_struct_variant_elt<V: Serialize>(
&mut self,
state: &mut State,
key: &'static str,
value: V
) -> Result<()>
[src]
&mut self,
state: &mut State,
key: &'static str,
value: V
) -> Result<()>
fn serialize_struct_variant_end(&mut self, state: State) -> Result<()>
[src]
Auto Trait Implementations
impl<W, F> RefUnwindSafe for Serializer<W, F> where
F: RefUnwindSafe,
W: RefUnwindSafe,
F: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, F> Send for Serializer<W, F> where
F: Send,
W: Send,
F: Send,
W: Send,
impl<W, F> Sync for Serializer<W, F> where
F: Sync,
W: Sync,
F: Sync,
W: Sync,
impl<W, F> Unpin for Serializer<W, F> where
F: Unpin,
W: Unpin,
F: Unpin,
W: Unpin,
impl<W, F> UnwindSafe for Serializer<W, F> where
F: UnwindSafe,
W: UnwindSafe,
F: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,