pub struct UnderlyingObjectFuture<T, O> { /* private fields */ }Expand description
It is used internally here, but left pub as maybe somebody could use it
in other circumstances.
Holds a pinned future of a function from an object and the object itself, guaranteeing by doing so
the lifetime of the object and its func-future to co-exist.
You need this if you want to poll a Future of a function from a object in
an async manner. As we hold the object together with the future of its
function in a tuple, the object lives at least as long as the future it
returns.
Implementations§
Source§impl<T, O> UnderlyingObjectFuture<T, O>
impl<T, O> UnderlyingObjectFuture<T, O>
Sourcepub fn new(object: T, getter: GetFutureFunc<T, O>) -> Self
pub fn new(object: T, getter: GetFutureFunc<T, O>) -> Self
Create new UnderlyingObjectFuture consuming the given object.
getter can be easily implemented using the impl_getter macro and defines
the function-future from the object-function.
Auto Trait Implementations§
impl<T, O> Freeze for UnderlyingObjectFuture<T, O>where
T: Freeze,
impl<T, O> !RefUnwindSafe for UnderlyingObjectFuture<T, O>
impl<T, O> !Send for UnderlyingObjectFuture<T, O>
impl<T, O> !Sync for UnderlyingObjectFuture<T, O>
impl<T, O> Unpin for UnderlyingObjectFuture<T, O>where
T: Unpin,
impl<T, O> !UnwindSafe for UnderlyingObjectFuture<T, O>
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