Trait hyper_ast::impact::serialize::MySerializer
source · pub trait MySerializer: Sized {
type Ok;
type Error: Error;
type SerializePar: MySerializePar<Ok = Self::Ok, Error = Self::Error>;
type SerializeSco: MySerializeSco<Ok = Self::Ok, Error = Self::Error>;
// Required methods
fn collect_str<T>(self, value: &T) -> Result<Self::Ok, Self::Error>
where T: Display + ?Sized;
fn serialize_par(
self,
len: Option<usize>
) -> Result<Self::SerializePar, Self::Error>;
fn serialize_sco(
self,
len: Option<usize>
) -> Result<Self::SerializeSco, Self::Error>;
}
Required Associated Types§
sourcetype Ok
type Ok
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.
sourcetype SerializePar: MySerializePar<Ok = Self::Ok, Error = Self::Error>
type SerializePar: MySerializePar<Ok = Self::Ok, Error = Self::Error>
Type returned from serialize_seq
for serializing the content of the
sequence.