[][src]Struct serde_rustler::Serializer

pub struct Serializer<'a> { /* fields omitted */ }

Trait Implementations

impl<'a> Clone for Serializer<'a>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Copy for Serializer<'a>[src]

impl<'a> From<Env<'a>> for Serializer<'a>[src]

impl<'a> Serializer for Serializer<'a>[src]

type Ok = Term<'a>

The output type produced by this Serializer during successful serialization. Most serializers that produce text or binary output should set Ok = () and serialize into an [io::Write] or buffer contained within the Serializer instance. Serializers that build in-memory data structures may be simplified by using Ok to propagate the data structure around. Read more

type Error = Error

The error type when some error occurs during serialization.

type SerializeSeq = SequenceSerializer<'a>

Type returned from [serialize_seq] for serializing the content of the sequence. Read more

type SerializeTuple = SequenceSerializer<'a>

Type returned from [serialize_tuple] for serializing the content of the tuple. Read more

type SerializeTupleStruct = SequenceSerializer<'a>

Type returned from [serialize_tuple_struct] for serializing the content of the tuple struct. Read more

type SerializeTupleVariant = SequenceSerializer<'a>

Type returned from [serialize_tuple_variant] for serializing the content of the tuple variant. Read more

type SerializeMap = MapSerializer<'a>

Type returned from [serialize_map] for serializing the content of the map. Read more

type SerializeStruct = MapSerializer<'a>

Type returned from [serialize_struct] for serializing the content of the struct. Read more

type SerializeStructVariant = MapSerializer<'a>

Type returned from [serialize_struct_variant] for serializing the content of the struct variant. Read more

fn serialize_unit(self) -> Result<Self::Ok, Self::Error>[src]

Serializes unit (empty tuple) as nil.

fn serialize_unit_struct(
    self,
    _name: &'static str
) -> Result<Self::Ok, Self::Error>
[src]

Serializes struct Unit as nil.

fn serialize_unit_variant(
    self,
    _name: &'static str,
    _variant_index: u32,
    variant: &'static str
) -> Result<Self::Ok, Self::Error>
[src]

Serializes E::A in enum E { A, B } as :A or "A", depending on if the atom :A has already been created.

fn serialize_newtype_struct<T: ?Sized>(
    self,
    name: &'static str,
    value: &T
) -> Result<Self::Ok, Self::Error> where
    T: Serialize
[src]

Serializes struct Millimeters(u8) as a tagged tuple: {:Millimeters, u8} or {"Millimeters", u8}, depending on if the atom :Millimeters has already been created.

fn serialize_newtype_variant<T: ?Sized>(
    self,
    _name: &'static str,
    _variant_index: u32,
    variant: &'static str,
    value: &T
) -> Result<Self::Ok, Self::Error> where
    T: Serialize
[src]

Serializes E::N in enum E { N(u8) } as a tagged tuple: {:N, u8} or {"N", u8}, depending on if the atom :N has already been created. Serializes Result::Ok and Result::Err of enum Result { Ok(u8), Err(_) } into {:ok, u8} or {:err, _}.

fn serialize_seq(
    self,
    len: Option<usize>
) -> Result<Self::SerializeSeq, Self::Error>
[src]

Serializes sequences as a Elixir lists.

fn serialize_tuple(
    self,
    len: usize
) -> Result<Self::SerializeTuple, Self::Error>
[src]

Serializes tuples as Elixir tuples.

fn serialize_tuple_struct(
    self,
    name: &'static str,
    len: usize
) -> Result<Self::SerializeTupleStruct, Self::Error>
[src]

Serializes struct Rgb(u8, u8, u8) as an Elixir Record or Record-like tuple: {:Rgb, u8, u8, u8} or {"Rgb", u8, u8, u8}.

fn serialize_tuple_variant(
    self,
    _name: &'static str,
    _variant_index: u32,
    variant: &'static str,
    len: usize
) -> Result<Self::SerializeTupleVariant, Self::Error>
[src]

Serializes E::T of enum E { T(u8, u8) } as an Elixir Record or Record-like tuple: {:T, u8, u8} or {"T", u8, u8}.

fn serialize_map(
    self,
    len: Option<usize>
) -> Result<Self::SerializeMap, Self::Error>
[src]

Serializes map as Elixir map. Keys will not serialize into atoms.

fn serialize_struct(
    self,
    name: &'static str,
    len: usize
) -> Result<Self::SerializeStruct, Self::Error>
[src]

Serializes as map, but attempts to include %{:__struct__ => :STRUCT_NAME} or ${:__struct__ => "STRUCT_NAME"}, if the atom :STRUCT_NAME has not already been created, and will also attempt to serialize keys as atoms.

fn serialize_struct_variant(
    self,
    _name: &'static str,
    _variant_index: u32,
    variant: &'static str,
    len: usize
) -> Result<Self::SerializeStructVariant, Self::Error>
[src]

Serializes the same as we serialize a struct: E::S of enum E { S { r: u8, g: u8, b: u8 } } is a map including %{:__struct__ => :S} or ${:__struct__ => "S"}.

fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
    I: IntoIterator,
    <I as IntoIterator>::Item: Serialize
[src]

Collect an iterator as a sequence. Read more

fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
    I: IntoIterator<Item = (K, V)>,
    K: Serialize,
    V: Serialize
[src]

Collect an iterator as a map. Read more

fn collect_str<T>(self, value: &T) -> Result<Self::Ok, Self::Error> where
    T: Display + ?Sized
[src]

Serialize a string produced by an implementation of Display. Read more

fn is_human_readable(&self) -> bool[src]

Determine whether Serialize implementations should serialize in human-readable form. Read more

Auto Trait Implementations

impl<'a> !Send for Serializer<'a>

impl<'a> !Sync for Serializer<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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

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

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