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