pub struct SinkPrepareSendFuture<'w, IF, OS, OM> {
generator: IF,
output: Option<Pin<&'w mut OS>>,
tw: PhantomData<fn(OM)>,
}Expand description
Future for SinkPrepareExt::prepare_send_from
Fields§
§generator: IFUnderlying future that will yield a message.
output: Option<Pin<&'w mut OS>>This Option exists because otherwise SinkPrepareSendFuture::poll()
can’t move output out of this struct to put it into the SinkSendable.
(The poll() impl cannot borrow from SinkPrepareSendFuture.)
tw: PhantomData<fn(OM)>fn(OM) gives contravariance in OM.
Variance is confusing. Loosely, a SinkPrepareSendFuture<..OM> consumes an OM. Actually, we don’t really need to add any variance restricions wrt OM, because the &mut OS already implies the correct variance, so we could have used the PhantomData<fn(*const OM)> trick. Happily there is no unsafe anywhere nearby, so it is not possible for us to write a bug due to getting the variance wrong - only to erroneously prevent some use case.
Implementations§
Source§impl<'w, IF, OS, OM> SinkPrepareSendFuture<'w, IF, OS, OM>
impl<'w, IF, OS, OM> SinkPrepareSendFuture<'w, IF, OS, OM>
Trait Implementations§
Source§impl<'w, IF, OS, IM, OM> FusedFuture for SinkPrepareSendFuture<'w, IF, OS, OM>
impl<'w, IF, OS, IM, OM> FusedFuture for SinkPrepareSendFuture<'w, IF, OS, OM>
Source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true if the underlying future should no longer be polled.Source§impl<'w, IF, OS, IM, OM> Future for SinkPrepareSendFuture<'w, IF, OS, OM>
impl<'w, IF, OS, IM, OM> Future for SinkPrepareSendFuture<'w, IF, OS, OM>
impl<'pin, 'w, IF, OS, OM> Unpin for SinkPrepareSendFuture<'w, IF, OS, OM>where
PinnedFieldsOf<__SinkPrepareSendFuture<'pin, 'w, IF, OS, OM>>: Unpin,
Auto Trait Implementations§
impl<'w, IF, OS, OM> !UnwindSafe for SinkPrepareSendFuture<'w, IF, OS, OM>
impl<'w, IF, OS, OM> Freeze for SinkPrepareSendFuture<'w, IF, OS, OM>where
IF: Freeze,
impl<'w, IF, OS, OM> RefUnwindSafe for SinkPrepareSendFuture<'w, IF, OS, OM>where
IF: RefUnwindSafe,
OS: RefUnwindSafe,
impl<'w, IF, OS, OM> Send for SinkPrepareSendFuture<'w, IF, OS, OM>
impl<'w, IF, OS, OM> Sync for SinkPrepareSendFuture<'w, IF, OS, OM>
impl<'w, IF, OS, OM> UnsafeUnpin for SinkPrepareSendFuture<'w, IF, OS, OM>where
IF: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
Source§fn map_into<U>(self) -> MapInto<Self, U>
fn map_into<U>(self) -> MapInto<Self, U>
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
f. Read moreSource§fn left_future<B>(self) -> Either<Self, B>
fn left_future<B>(self) -> Either<Self, B>
Source§fn right_future<A>(self) -> Either<A, Self>
fn right_future<A>(self) -> Either<A, Self>
Source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
Source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
poll will never again be called once it has
completed. This method can be used to turn any Future into a
FusedFuture. Read moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
() on completion and sends
its output to another future on a separate task. Read moreSource§fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
Source§fn unit_error(self) -> UnitError<Self>where
Self: Sized,
fn unit_error(self) -> UnitError<Self>where
Self: Sized,
Future<Output = T> into a
TryFuture<Ok = T, Error = ()>.Source§fn never_error(self) -> NeverError<Self>where
Self: Sized,
fn never_error(self) -> NeverError<Self>where
Self: Sized,
Future<Output = T> into a
TryFuture<Ok = T, Error = Never>.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn delay(self, dur: Duration) -> DelayFuture<Self>where
Self: Sized,
fn delay(self, dur: Duration) -> DelayFuture<Self>where
Self: Sized,
Source§fn flatten(self) -> FlattenFuture<Self, <Self::Output as IntoFuture>::Future>
fn flatten(self) -> FlattenFuture<Self, <Self::Output as IntoFuture>::Future>
Source§fn race<F>(self, other: F) -> Race<Self, F>
fn race<F>(self, other: F) -> Race<Self, F>
Source§fn try_race<F, T, E>(self, other: F) -> TryRace<Self, F>
fn try_race<F, T, E>(self, other: F) -> TryRace<Self, F>
Source§fn join<F>(self, other: F) -> Join<Self, F>
fn join<F>(self, other: F) -> Join<Self, F>
Source§impl<F> FutureExt for F
impl<F> FutureExt for F
Source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
fn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
CancellationToken::run_until_cancelled,
but with the advantage that it is easier to write fluent call chains. Read moreSource§fn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
fn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
CancellationToken::run_until_cancelled_owned,
but with the advantage that it is easier to write fluent call chains. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more