LazySinkSource

Struct LazySinkSource 

Source
pub struct LazySinkSource<Fut, St, Si, Item, Error> { /* private fields */ }
Expand description

A lazy sink-source that can be split into a sink and a source. The internal state is initialized when the first item is attempted to be pulled from the source half, or when the first item is sent to the sink half.

Implementations§

Source§

impl<Fut, St, Si, Item, Error> LazySinkSource<Fut, St, Si, Item, Error>

Source

pub fn new(future: Fut) -> Self

Creates a new LazySinkSource with the given initialization future.

Source

pub fn split( self, ) -> (LazySinkHalf<Fut, St, Si, Item, Error>, LazySourceHalf<Fut, St, Si, Item, Error>)

Splits into a sink and stream that share the same underlying connection.

Auto Trait Implementations§

§

impl<Fut, St, Si, Item, Error> Freeze for LazySinkSource<Fut, St, Si, Item, Error>

§

impl<Fut, St, Si, Item, Error> !RefUnwindSafe for LazySinkSource<Fut, St, Si, Item, Error>

§

impl<Fut, St, Si, Item, Error> !Send for LazySinkSource<Fut, St, Si, Item, Error>

§

impl<Fut, St, Si, Item, Error> !Sync for LazySinkSource<Fut, St, Si, Item, Error>

§

impl<Fut, St, Si, Item, Error> Unpin for LazySinkSource<Fut, St, Si, Item, Error>
where Error: Unpin,

§

impl<Fut, St, Si, Item, Error> !UnwindSafe for LazySinkSource<Fut, St, Si, Item, Error>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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<T> ToSinkBuild for T

Source§

fn iter_to_sink_build(self) -> SendIterBuild<Self>
where Self: Sized + Iterator,

Starts a SinkBuild adaptor chain to send all items from self as an Iterator.
Source§

fn stream_to_sink_build(self) -> SendStreamBuild<Self>
where Self: Sized + Stream,

Starts a SinkBuild adaptor chain to send all items from self as a [Stream].
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.