Trait serde::ser::SerializeTupleVariant [] [src]

pub trait SerializeTupleVariant {
    type Ok;
    type Error: Error;
    fn serialize_field<T: ?Sized + Serialize>(
        &mut self,
        value: &T
    ) -> Result<(), Self::Error>;
fn end(self) -> Result<Self::Ok, Self::Error>; }

Returned from Serializer::serialize_tuple_variant.

This example is not tested
match *self {
    E::T(ref a, ref b) => {
        let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?;
        tv.serialize_field(a)?;
        tv.serialize_field(b)?;
        tv.end()
    }
}

Associated Types

Must match the Ok type of our Serializer.

Must match the Error type of our Serializer.

Required Methods

Serialize a tuple variant field.

Finish serializing a tuple variant.

Implementors