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: IF
Underlying 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>where
IF: Future<Output = IM>,
OS: Sink<OM>,
impl<'w, IF, OS, IM, OM> FusedFuture for SinkPrepareSendFuture<'w, IF, OS, OM>where
IF: Future<Output = IM>,
OS: Sink<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>where
IF: Future<Output = IM>,
OS: Sink<OM>,
impl<'w, IF, OS, IM, OM> Future for SinkPrepareSendFuture<'w, IF, OS, OM>where
IF: Future<Output = IM>,
OS: Sink<OM>,
Source§type Output = Result<(IM, SinkSendable<'w, OS, OM>), <OS as Sink<OM>>::Error>
type Output = Result<(IM, SinkSendable<'w, OS, OM>), <OS as Sink<OM>>::Error>
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> !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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
§fn map_into<U>(self) -> MapInto<Self, U>
fn map_into<U>(self) -> MapInto<Self, U>
§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
f
. Read more§fn left_future<B>(self) -> Either<Self, B>
fn left_future<B>(self) -> Either<Self, B>
§fn right_future<A>(self) -> Either<A, Self>
fn right_future<A>(self) -> Either<A, Self>
§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
§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 more§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
§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 more§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>>
§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,
§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 = ()
>.§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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
§impl<F, T, E> TryFuture for F
impl<F, T, E> TryFuture for F
§impl<Fut> TryFutureExt for Futwhere
Fut: TryFuture + ?Sized,
impl<Fut> TryFutureExt for Futwhere
Fut: TryFuture + ?Sized,
§fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>where
Self::Ok: Sink<Item, Error = Self::Error>,
Self: Sized,
fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>where
Self::Ok: Sink<Item, Error = Self::Error>,
Self: Sized,
Sink
]. Read more