pub struct Pending<'a, T> { /* private fields */ }Expand description
Pending is a decode result on its way.
It is a Future: .await it on any single-threaded executor, or wrap it so its waker also
wakes an event loop. A host that runs a frame loop instead calls try_take
once a frame. Dropping a Pending cancels the work if it has not started.
The lifetime is what a frame borrows from its Codec: opening an image
answers a Pending<'static, _>, while a frame keeps the codec borrowed until it arrives, so
one codec cannot be decoding two frames at once.
The type is !Send on purpose: the inline loader runs the decode inside poll, on the
polling thread, and an opened codec belongs to that thread too.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for Pending<'a, T>
impl<'a, T> !Send for Pending<'a, T>
impl<'a, T> !Sync for Pending<'a, T>
impl<'a, T> !UnwindSafe for Pending<'a, T>
impl<'a, T> Freeze for Pending<'a, T>
impl<'a, T> Unpin for Pending<'a, T>
impl<'a, T> UnsafeUnpin for Pending<'a, T>
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more