Struct futures::compat::CompatSink

source ·
pub struct CompatSink<T, Item> { /* private fields */ }
Available on crate feature compat only.
Expand description

Converts a futures 0.3 Sink into a futures 0.1 Sink.

Implementations§

source§

impl<T, Item> CompatSink<T, Item>

source

pub fn new(inner: T) -> CompatSink<T, Item>

Creates a new CompatSink.

source

pub fn get_ref(&self) -> &T

Get a reference to 0.3 Sink contained within.

source

pub fn get_mut(&mut self) -> &mut T

Get a mutable reference to 0.3 Sink contained within.

source

pub fn into_inner(self) -> T

Returns the inner item.

Trait Implementations§

source§

impl<T, Item> Debug for CompatSink<T, Item>where T: Debug, Item: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, Item> Sink for CompatSink<T, Item>where T: Sink<Item> + Unpin,

§

type SinkItem = Item

The type of value that the sink accepts.
§

type SinkError = <T as Sink<Item>>::Error

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

fn start_send( &mut self, item: <CompatSink<T, Item> as Sink>::SinkItem ) -> Result<AsyncSink<<CompatSink<T, Item> as Sink>::SinkItem>, <CompatSink<T, Item> as Sink>::SinkError>

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

fn poll_complete( &mut self ) -> Result<Async<()>, <CompatSink<T, Item> as Sink>::SinkError>

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

fn close( &mut self ) -> Result<Async<()>, <CompatSink<T, Item> as Sink>::SinkError>

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

fn wait(self) -> Wait<Self>where Self: Sized,

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

fn with<U, F, Fut>(self, f: F) -> With<Self, U, F, Fut>where F: FnMut(U) -> Fut, Fut: IntoFuture<Item = Self::SinkItem>, <Fut as IntoFuture>::Error: From<Self::SinkError>, Self: Sized,

Composes a function in front of the sink. Read more
source§

fn with_flat_map<U, F, St>(self, f: F) -> WithFlatMap<Self, U, F, St>where F: FnMut(U) -> St, St: Stream<Item = Self::SinkItem, Error = Self::SinkError>, Self: Sized,

Composes a function in front of the sink. Read more
source§

fn sink_map_err<F, E>(self, f: F) -> SinkMapErr<Self, F>where F: FnOnce(Self::SinkError) -> E, Self: Sized,

Transforms the error returned by the sink.
source§

fn sink_from_err<E>(self) -> SinkFromErr<Self, E>where E: From<Self::SinkError>, Self: Sized,

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

fn buffer(self, amt: usize) -> Buffer<Self>where Self: Sized,

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

fn flush(self) -> Flush<Self>where Self: Sized,

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

fn send(self, item: Self::SinkItem) -> Send<Self>where Self: Sized,

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

fn send_all<S>(self, stream: S) -> SendAll<Self, S>where S: Stream<Item = Self::SinkItem>, Self::SinkError: From<<S as Stream>::Error>, Self: Sized,

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

Auto Trait Implementations§

§

impl<T, Item> RefUnwindSafe for CompatSink<T, Item>where T: RefUnwindSafe,

§

impl<T, Item> Send for CompatSink<T, Item>where T: Send,

§

impl<T, Item> Sync for CompatSink<T, Item>where T: Sync,

§

impl<T, Item> Unpin for CompatSink<T, Item>where T: Unpin,

§

impl<T, Item> UnwindSafe for CompatSink<T, Item>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Si> Sink01CompatExt for Siwhere Si: Sink,

source§

fn sink_compat(self) -> Compat01As03Sink<Self, Self::SinkItem>where Self: Sized,

Converts a futures 0.1 Sink<SinkItem = T, SinkError = E> into a futures 0.3 Sink<T, Error = E>. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.