Trait dencode::IterSink[][src]

pub trait IterSink<Item> {
    type Error;
    fn ready(&mut self) -> Result<(), Self::Error>;
fn start_send(&mut self, item: Item) -> Result<(), Self::Error>;
fn flush(&mut self) -> Result<(), Self::Error>; }
Expand description

An IterSink is a value into which other values can be sent.

Values are sent in two phases: first by internally buffering the value, and then actually writing the value upon flushing.

Associated Types

type Error[src]

Expand description

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

Required methods

fn ready(&mut self) -> Result<(), Self::Error>[src]

Expand description

Attempts to prepare the IterSink to receive a value, adjusting the internal buffer if necessary.

This method must be called prior to each call to start_send.

fn start_send(&mut self, item: Item) -> Result<(), Self::Error>[src]

Expand description

Write a value to the internal buffer. Each call to this function must be preceded by a successful call to ready.

fn flush(&mut self) -> Result<(), Self::Error>[src]

Expand description

Flush any remaining output from this sink’s internal buffer.

Implementors

impl<T, E, I> IterSink<I> for FramedWrite<T, E> where
    T: Write,
    E: Encoder<I>, 
[src]

type Error = E::Error

fn start_send(&mut self, item: I) -> Result<(), Self::Error>[src]

fn ready(&mut self) -> Result<(), Self::Error>[src]

fn flush(&mut self) -> Result<(), Self::Error>[src]

impl<T, U, I> IterSink<I> for Framed<T, U> where
    T: Write,
    U: Encoder<I>, 
[src]

type Error = U::Error

fn start_send(&mut self, item: I) -> Result<(), Self::Error>[src]

fn ready(&mut self) -> Result<(), Self::Error>[src]

fn flush(&mut self) -> Result<(), Self::Error>[src]