Struct diny::Serializer [−][src]
pub struct Serializer<F, W> {
pub format: F,
pub writer: W,
}
Expand description
A wrapper type around a specific (format)backend::FormatEncode and (writer)io::AsyncWrite
Fields
format: F
The (format)backend::FormatEncode used for encoding
writer: W
The (writer)io::AsyncWrite to write (serialized)backend::AsyncSerialize bytes to
Implementations
Instantiates a new (Serializer) from the (format)backend::FormatEncode and (writer)io::AsyncWrite
pub fn into_sink<D>(self) -> Serialize<F, W, D> where
F: FormatEncode,
W: AsyncWrite + Unpin,
D: Encodable,
pub fn into_sink<D>(self) -> Serialize<F, W, D> where
F: FormatEncode,
W: AsyncWrite + Unpin,
D: Encodable,
Converts the (Deserializer) into a sink for D
’s
pub fn serialize<D>(&'w mut self, data: &'w D) -> <D as AsyncSerialize>::Future where
F: FormatSerialize,
W: AsyncWrite + Unpin,
D: AsyncSerialize,
pub fn serialize<D>(&'w mut self, data: &'w D) -> <D as AsyncSerialize>::Future where
F: FormatSerialize,
W: AsyncWrite + Unpin,
D: AsyncSerialize,
Serializes a single object of type D