pub struct ActivityFuture<F> { /* private fields */ }Available on crate feature
async only.Expand description
Future wrapper that re-enters an OSActivity every time the executor polls it.
Implementations§
Source§impl<F> ActivityFuture<F>
impl<F> ActivityFuture<F>
Sourcepub const fn new(activity: OSActivity, future: F) -> Self
pub const fn new(activity: OSActivity, future: F) -> Self
Wrap future so each poll executes inside activity.
Sourcepub const fn activity(&self) -> &OSActivity
pub const fn activity(&self) -> &OSActivity
Borrow the activity that will be entered around each poll.
Source§impl<F> ActivityFuture<F>where
F: Future,
impl<F> ActivityFuture<F>where
F: Future,
Sourcepub fn into_parts(self) -> (OSActivity, F)
pub fn into_parts(self) -> (OSActivity, F)
Unwrap the wrapper and return the owned activity plus inner future.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for ActivityFuture<F>where
F: Freeze,
impl<F> RefUnwindSafe for ActivityFuture<F>where
F: RefUnwindSafe,
impl<F> !Send for ActivityFuture<F>
impl<F> !Sync for ActivityFuture<F>
impl<F> Unpin for ActivityFuture<F>where
F: Unpin,
impl<F> UnsafeUnpin for ActivityFuture<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for ActivityFuture<F>where
F: UnwindSafe,
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
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