Struct diny::Serializer [−][src]
pub struct Serializer<F, W> {
pub format: F,
pub writer: W,
}
Fields
format: F
writer: W
The writer to write serialized bytes to
Implementations
Instantiates a new Serializer from the format and writer
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 Serializer 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
pub fn flush(
&mut self
) -> impl Future<Output = Result<(), <F as Format>::Error>> where
F: FormatSerialize,
W: AsyncWrite + Unpin,
pub fn flush(
&mut self
) -> impl Future<Output = Result<(), <F as Format>::Error>> where
F: FormatSerialize,
W: AsyncWrite + Unpin,
Flushes the underlying writer