zephyr::work::futures

Struct JoinHandle

Source
pub struct JoinHandle<F: Future> { /* private fields */ }
Expand description

A potentially running Work.

This encapsulates a Future that is potentially running in the Zephyr work queue system.

§Safety

Once the worker has been started (meaning once WorkBuilder::start returns this Work), all but one field here is owned by the worker itself (it runs on the worker thread, hence the Send constraint). The exception is the ‘answer’ field which can be used by the caller to wait for the Work to finish.

Implementations§

Source§

impl<F: Future> JoinHandle<F>

Source

pub fn join(&self) -> F::Output

Synchronously wait for this future to have an answer.

Source

pub async fn join_async(&self) -> F::Output

Asynchronously wait for this future to have an answer.

Trait Implementations§

Source§

impl<F> Send for JoinHandle<F>
where F: Future, F::Output: Send,

Auto Trait Implementations§

§

impl<F> Freeze for JoinHandle<F>

§

impl<F> !RefUnwindSafe for JoinHandle<F>

§

impl<F> Sync for JoinHandle<F>
where <F as Future>::Output: Send,

§

impl<F> Unpin for JoinHandle<F>

§

impl<F> !UnwindSafe for JoinHandle<F>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.