pub struct NativeFuture<T> { /* private fields */ }Expand description
A one-shot native completion exposed as a Rust future.
The future resolves to an Error when the operation fails, which for a
command means it failed or was cancelled.
Native has accepted the operation by the time the call that returns this future returns, and runs it whether or not anything awaits the result. Dropping the future doesn’t cancel the operation; native still delivers and frees its result.
Implementations§
Source§impl<T> NativeFuture<T>
impl<T> NativeFuture<T>
Sourcepub fn wait(self) -> Result<T>
pub fn wait(self) -> Result<T>
Blocks the calling thread until native delivers the result. An
operation that completes only while this thread services it, such as a
caller-driven render session’s release, needs wait_timeout or an
executor instead.
Sourcepub fn wait_timeout(self, timeout: Duration) -> Result<Result<T>, Self>
pub fn wait_timeout(self, timeout: Duration) -> Result<Result<T>, Self>
Blocks the calling thread for at most timeout and returns the result,
or gives the future back when the timeout ends first. This serves hosts
that must pump another service loop between waits rather than run an
async executor.
Trait Implementations§
Source§impl<T> Debug for NativeFuture<T>
impl<T> Debug for NativeFuture<T>
Source§impl<T> Future for NativeFuture<T>
impl<T> Future for NativeFuture<T>
Auto Trait Implementations§
impl<T> Freeze for NativeFuture<T>
impl<T> RefUnwindSafe for NativeFuture<T>
impl<T> Send for NativeFuture<T>where
T: Send,
impl<T> Sync for NativeFuture<T>where
T: Send,
impl<T> Unpin for NativeFuture<T>
impl<T> UnsafeUnpin for NativeFuture<T>
impl<T> UnwindSafe for NativeFuture<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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more