Trait serde::ser::SerializeStructVariant
[−]
[src]
pub trait SerializeStructVariant { type Ok; type Error: Error; fn serialize_field<V: Serialize>(&mut self,
key: &'static str,
value: V)
-> Result<(), Self::Error>; fn end(self) -> Result<Self::Ok, Self::Error>; }
Returned from Serializer::serialize_struct_variant
.
Associated Types
type Ok
Trickery to enforce correct use of the Serialize
trait. Every
SerializeStructVariant
should set Ok = ()
.
type Error: Error
The error type when some error occurs during serialization.
Required Methods
fn serialize_field<V: Serialize>(&mut self,
key: &'static str,
value: V)
-> Result<(), Self::Error>
key: &'static str,
value: V)
-> Result<(), Self::Error>
Serialize a struct variant element.
fn end(self) -> Result<Self::Ok, Self::Error>
Finishes serializing a struct variant.