Trait StreamWait

Source
pub trait StreamWait {
    // Required methods
    fn id(&self) -> usize;
    fn wait(&self, need: usize) -> bool;
    fn closed(&self) -> bool;
}
Expand description

Wait on a stream.

For ReadStream, wait until there’s enough to read. For WriteStream, wait until there’s enough to write something.

Required Methods§

Source

fn id(&self) -> usize

ID shared between read and write side.

Source

fn wait(&self, need: usize) -> bool

Wait for “a while” or until need samples are available/space available.

Return true if need will never be satisfied, and blocks waiting for it should just go ahead and EOF.

Source

fn closed(&self) -> bool

Return true if the other end of this stream is disconnected.

Implementors§