Struct packet_stream_codec::CodecSink [] [src]

pub struct CodecSink<W, B> { /* fields omitted */ }

This sink consumes pairs of Metadata and AsRef<[u8]>s of type B and encodes them into the wrapped AsyncWrite of type W.

Methods

impl<W, B> CodecSink<W, B>
[src]

[src]

Create a new CodecSink, wrapping the given writer.

[src]

Consume the CodecSink to retrieve ownership of the inner writer.

Trait Implementations

impl<W, B> Sink for CodecSink<W, B> where
    W: AsyncWrite,
    B: AsRef<[u8]>, 
[src]

The length of the [u8] may not be larger than u32::max_value(). Otherwise, start_send returns an error of kind InvalidInput.

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

[src]

Attempts to prepare the Sink to receive a value. Read more

[src]

Begin the process of sending a value to the sink. Each call to this function must be proceeded by a successful call to poll_ready which returned Ok(Async::Ready(())). Read more

[src]

Flush any remaining output from this sink. Read more

[src]

Flush any remaining output and close this sink, if necessary. Read more

Auto Trait Implementations

impl<W, B> Send for CodecSink<W, B> where
    B: Send,
    W: Send

impl<W, B> Sync for CodecSink<W, B> where
    B: Sync,
    W: Sync