Struct futures::sink::Buffer [−][src]
#[must_use = "sinks do nothing unless polled"]pub struct Buffer<Si> where
Si: Sink, { /* fields omitted */ }
Sink for the Sink::buffer
combinator, which buffers up to some fixed
number of values when the underlying sink is unable to accept them.
Methods
impl<Si> Buffer<Si> where
Si: Sink,
[src]
impl<Si> Buffer<Si> where
Si: Sink,
ⓘImportant traits for &'a mut Ipub fn get_ref(&self) -> &Si
[src]
pub fn get_ref(&self) -> &Si
Get a shared reference to the inner sink.
Trait Implementations
impl<Si> Sink for Buffer<Si> where
Si: Sink,
[src]
impl<Si> Sink for Buffer<Si> where
Si: Sink,
type SinkItem = <Si as Sink>::SinkItem
The type of value that the sink accepts.
type SinkError = <Si as Sink>::SinkError
The type of value produced by the sink when an error occurs.
fn poll_ready(
self: PinMut<Buffer<Si>>,
cx: &mut Context
) -> Poll<Result<(), <Buffer<Si> as Sink>::SinkError>>
[src]
fn poll_ready(
self: PinMut<Buffer<Si>>,
cx: &mut Context
) -> Poll<Result<(), <Buffer<Si> as Sink>::SinkError>>
Attempts to prepare the Sink
to receive a value. Read more
fn start_send(
self: PinMut<Buffer<Si>>,
item: <Buffer<Si> as Sink>::SinkItem
) -> Result<(), <Buffer<Si> as Sink>::SinkError>
[src]
fn start_send(
self: PinMut<Buffer<Si>>,
item: <Buffer<Si> as Sink>::SinkItem
) -> Result<(), <Buffer<Si> as Sink>::SinkError>
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(Poll::Ready(()))
. Read more
fn poll_flush(
self: PinMut<Buffer<Si>>,
cx: &mut Context
) -> Poll<Result<(), <Buffer<Si> as Sink>::SinkError>>
[src]
fn poll_flush(
self: PinMut<Buffer<Si>>,
cx: &mut Context
) -> Poll<Result<(), <Buffer<Si> as Sink>::SinkError>>
Flush any remaining output from this sink. Read more
fn poll_close(
self: PinMut<Buffer<Si>>,
cx: &mut Context
) -> Poll<Result<(), <Buffer<Si> as Sink>::SinkError>>
[src]
fn poll_close(
self: PinMut<Buffer<Si>>,
cx: &mut Context
) -> Poll<Result<(), <Buffer<Si> as Sink>::SinkError>>
Flush any remaining output and close this sink, if necessary. Read more
impl<Si> Unpin for Buffer<Si> where
Si: Unpin + Sink,
[src]
impl<Si> Unpin for Buffer<Si> where
Si: Unpin + Sink,
impl<Si> Debug for Buffer<Si> where
Si: Debug + Sink,
<Si as Sink>::SinkItem: Debug,
[src]
impl<Si> Debug for Buffer<Si> where
Si: Debug + Sink,
<Si as Sink>::SinkItem: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<S> Stream for Buffer<S> where
S: Sink + Stream,
[src]
impl<S> Stream for Buffer<S> where
S: Sink + Stream,
type Item = <S as Stream>::Item
Values yielded by the stream.
fn poll_next(
self: PinMut<Buffer<S>>,
cx: &mut Context
) -> Poll<Option<<S as Stream>::Item>>
[src]
fn poll_next(
self: PinMut<Buffer<S>>,
cx: &mut Context
) -> Poll<Option<<S as Stream>::Item>>
Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None
if the stream is exhausted. Read more