Struct tokio_serde::FramedWrite [] [src]

pub struct FramedWrite<T, U, S> where
    T: Sink
{ /* fields omitted */ }

Adapts a buffer sink to a value sink by serializing the values.

The provided buffer sink will received buffer values containing the serialized value. Each buffer contains exactly one value. This sink will be responsible for writing these buffers to an AsyncWrite using some sort of framing strategy. The specific framing strategy is left up to the implementor. One option would be to use length_delimited provided by tokio-io.

Methods

impl<T, U, S> FramedWrite<T, U, S> where
    T: Sink<SinkItem = BytesMut>,
    S: Serializer<U>,
    S::Error: Into<T::SinkError>, 
[src]

[src]

Creates a new FramedWrite with the given buffer sink and serializer.

impl<T: Sink, U, S> FramedWrite<T, U, S>
[src]

[src]

Returns a reference to the underlying sink wrapped by FramedWrite.

Note that care should be taken to not tamper with the underlying sink as it may corrupt the sequence of frames otherwise being worked with.

[src]

Returns a mutable reference to the underlying sink wrapped by FramedWrite.

Note that care should be taken to not tamper with the underlying sink as it may corrupt the sequence of frames otherwise being worked with.

[src]

Consumes the FramedWrite, returning its underlying sink.

Note that care should be taken to not tamper with the underlying sink as it may corrupt the sequence of frames otherwise being worked with.

Trait Implementations

impl<T, U, S> Sink for FramedWrite<T, U, S> where
    T: Sink<SinkItem = BytesMut>,
    S: Serializer<U>,
    S::Error: Into<T::SinkError>, 
[src]

The type of value that the sink accepts.

The type of value produced by the sink when an error occurs.

[src]

Begin the process of sending a value to the sink. Read more

[src]

Flush all output from this sink, if necessary. Read more

[src]

A method to indicate that no more values will ever be pushed into this sink. Read more

[src]

Creates a new object which will produce a synchronous sink. Read more

[src]

Composes a function in front of the sink. Read more

[src]

Composes a function in front of the sink. Read more

[src]

Transforms the error returned by the sink.

[src]

Map this sink's error to any error implementing From for this sink's Error, returning a new sink. Read more

[src]

Adds a fixed-size buffer to the current sink. Read more

[src]

Fanout items to multiple sinks. Read more

[src]

A future that completes when the sink has finished processing all pending requests. Read more

[src]

A future that completes after the given item has been fully processed into the sink, including flushing. Read more

[src]

A future that completes after the given stream has been fully processed into the sink, including flushing. Read more