pub struct LocalScopedStreamSink<'env, SI, RI, E> { /* private fields */ }
Expand description

Locally scoped version of StreamSink. Does not implement Send.

Implementations§

source§

impl<'env, SI, RI, E> LocalScopedStreamSink<'env, SI, RI, E>

source

pub fn new<F>(f: F) -> Self
where for<'scope> F: FnOnce(LocalStreamPart<'scope, 'env, SI, RI, E>, LocalSinkPart<'scope, 'env, SI, RI, E>) -> Pin<Box<dyn Future<Output = Result<(), E>> + 'scope>>,

Creates new LocalScopedStreamSink. Safety is guaranteed by scoping both LocalStreamPart and LocalSinkPart.

Trait Implementations§

source§

impl<'env, SI, RI, E> StreamSink<SI, RI> for LocalScopedStreamSink<'env, SI, RI, E>

§

type Error = E

The error type that it may return.
source§

fn poll_stream_sink( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> State<SI, Self::Error>

source§

fn start_send(self: Pin<&mut Self>, item: RI) -> Result<(), Self::Error>

Starts sending item into StreamSink. Read more
source§

fn poll_close( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<Option<SI>, Self::Error>>

Close the StreamSink from outside. Implementation must be idempotent. Read more
source§

impl<'__pin, 'env, SI, RI, E> Unpin for LocalScopedStreamSink<'env, SI, RI, E>
where __Origin<'__pin, 'env, SI, RI, E>: Unpin,

Auto Trait Implementations§

§

impl<'env, SI, RI, E> !RefUnwindSafe for LocalScopedStreamSink<'env, SI, RI, E>

§

impl<'env, SI, RI, E> !Send for LocalScopedStreamSink<'env, SI, RI, E>

§

impl<'env, SI, RI, E> !Sync for LocalScopedStreamSink<'env, SI, RI, E>

§

impl<'env, SI, RI, E> !UnwindSafe for LocalScopedStreamSink<'env, SI, RI, E>

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<SI, RI, T> StreamSinkExt<SI, RI> for T
where T: StreamSink<SI, RI>,

source§

fn map_send<F, I>(self, f: F) -> MapSend<Self, F, SendItem>
where Self: Sized, F: FnMut(SendItem) -> I,

Maps the SendItem.
source§

fn map_recv<F, I>(self, f: F) -> MapRecv<Self, F, I>
where Self: Sized, F: FnMut(I) -> RecvItem,

Maps the RecvItem.
source§

fn map_error<F, E>(self, f: F) -> MapError<Self, F>
where Self: Sized, F: FnMut(Self::Error) -> E,

Maps the error type.
source§

fn error_cast<E>(self) -> ErrorCast<Self, E>
where Self: Sized, Self::Error: Into<E>,

Cast the error type.
source§

fn chain<Other, Item>(self, other: Other) -> Chain<Self, Other, SendItem>
where Self: Sized, Other: StreamSink<Item, SendItem, Error = Self::Error>,

source§

fn send_one<'a>( self: Pin<&'a mut Self>, item: RecvItem ) -> SendOne<'a, Self, SendItem, RecvItem, Self::Error>

Send one item. Read more
source§

fn send_iter<'a, I: IntoIterator<Item = RecvItem>>( self: Pin<&'a mut Self>, iter: I ) -> SendIter<'a, Self, SendItem, RecvItem, I::IntoIter, Self::Error>

Send items from an IntoIterator. Read more
source§

fn send_try_iter<'a, I: IntoIterator<Item = Result<RecvItem, Self::Error>>>( self: Pin<&'a mut Self>, iter: I ) -> SendTryIter<'a, Self, SendItem, RecvItem, I::IntoIter, Self::Error>

Send items from a fallible IntoIterator. Read more
source§

fn close<'a>(self: Pin<&'a mut Self>) -> Close<'a, Self, SendItem, RecvItem>

Closes the StreamSink. Read more
source§

fn ready<'a>(self: Pin<&'a mut Self>) -> Ready<'a, Self, SendItem, RecvItem>

Polls until it’s ready. It is safe drop the Future before it’s ready (cancel-safety). Read more
source§

fn try_send_one<'a, F: FnOnce() -> RecvItem>( self: Pin<&'a mut Self>, f: F ) -> TrySendOne<'a, Self, SendItem, F>

Try to send an item. It is safe to drop the Future before it’s ready.
source§

fn try_send_future<'a, F: Future<Output = Result<RecvItem, Self::Error>>>( self: Pin<&'a mut Self>, fut: F ) -> TrySendFuture<'a, Self, SendItem, F>

Try to send an item using Future. It is cancen-safe if and only if the inner Future is also cancel-safe.
source§

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

§

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>,

§

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.