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> 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,
impl<'w, IF, OS, OM> !UnwindSafe for SinkPrepareSendFuture<'w, IF, OS, OM>
Blanket Implementations§
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
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>.