Skip to main content
QAROS Rust API Dev (main) · versions: Dev (main) · Developer Guide

PendingCall

Struct PendingCall 

Source
pub struct PendingCall<T> { /* private fields */ }
Expand description

An async call in flight: a render sender creation (crate::Session::start_render_sender), an onboard or rejoin (crate::Runtime::start_onboard, crate::Runtime::start_rejoin), a co-process invite (crate::Session::start_onboarding_invite), a target-app invite or kill (crate::Session::start_invite_target_app, crate::Session::start_kill_target_app), or a begin-frame (crate::RenderSender::start_owned_frame). It keeps its owner alive.

The library calls back exactly once: with the outcome, or with crate::StatusCode::TIMEOUT once the call’s cancel token is cancelled (PendingCall::cancel_handle, the start’s timeout, or dropping this value). A cancel arriving just as the call finishes may still deliver the outcome.

Dropping it before the outcome is taken cancels the call and returns at once. The owner keeps the call until its callback: a handle it still delivers is destroyed by the owner’s next call or by the owner’s teardown, whose destroy waits for the callback.

Implementations§

Source§

impl<T> PendingCall<T>

Source

pub fn poll(&mut self) -> Option<Result<T>>

Never blocks. None while the call runs; once it called back, the value or the error it delivered (crate::StatusCode::TIMEOUT for a cancelled or timed-out call). Polling again after that returns Error::InvalidArgument.

Source

pub fn wait(self) -> Result<T>

Blocks until the library called back, which the header guarantees, and returns what PendingCall::poll would.

Source

pub fn cancel_handle(&self) -> Option<CancelHandle>

Cancels the call from any thread while it runs; the library then calls back with crate::StatusCode::TIMEOUT (or the outcome, when the call was just finishing). None once the outcome was taken.

Trait Implementations§

Source§

impl<T> Debug for PendingCall<T>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Drop for PendingCall<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for PendingCall<T>

§

impl<T> !Send for PendingCall<T>

§

impl<T> !Sync for PendingCall<T>

§

impl<T> !UnwindSafe for PendingCall<T>

§

impl<T> Freeze for PendingCall<T>

§

impl<T> Unpin for PendingCall<T>

§

impl<T> UnsafeUnpin for PendingCall<T>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.