Skip to main content

App

Struct App 

Source
pub struct App<'app, 'life: 'app, 'd: 'life, D: Layout<'d>, Q = ()> { /* private fields */ }
Expand description

Live application view scoped to one installed session.

Implementations§

Source§

impl<'app, 'life: 'app, 'd: 'life, D, Q> App<'app, 'life, 'd, D, Q>
where D: App<'d>,

Source

pub fn drive<R>(&mut self, root: R) -> Result<R::Output, Error>
where R: Root<'d>,

Source

pub fn run(self) -> Result<Requested<Q>, Error>

Source

pub fn drive_until<R>( self, root: R, ) -> Result<ControlFlow<R::Output, Requested<Q>>, Error>
where R: Root<'d>,

Returns a completed root or the shutdown request after dropping the pending root. A root completed in the shutdown turn keeps its output.

Source

pub fn drive_for<R>( &mut self, timeout: Duration, root: R, ) -> Result<R::Output, Error>
where R: Root<'d>,

Drives one root with a wall-clock deadline, checked between executor turns. Each root poll must return to the executor for the deadline to be observed.

Source

pub fn run_for(self, timeout: Duration) -> Result<Requested<Q>, Error>

Serves until shutdown or the wall-clock deadline, checked between turns. Each application transition must return to the executor.

Source

pub fn run_drain(self, timeout: Positive) -> Result<Report<Q>, Error>
where D: Drain<'d>,

Source

pub fn drive_drain<R>( self, timeout: Positive, root: R, ) -> Result<ControlFlow<R::Output, Report<Q>>, Error>
where D: Drain<'d>, R: Root<'d>,

Returns a completed root, or drains after shutdown once the pending root is dropped. A root completed in the shutdown turn keeps its output; the drain timeout starts at shutdown.

Methods from Deref<Target = Access<'app, 'life, 'd, D, Q>>§

Source

pub fn state_token(&mut self) -> &mut Token<Identity<'d, 1>>

Source

pub fn root_client(&mut self) -> <D::Provider as Provider<'d>>::Client<'app>
where D: Root<'d>, D::Provider: 'app,

Issues the client of the complete installed root.

Source

pub fn client<P>( &mut self, select: impl for<'borrow> FnOnce(Pin<&'borrow D>) -> Pin<&'borrow P>, ) -> <P::Provider as Provider<'d>>::Client<'app>
where P: Root<'d>, P::Provider: 'app,

Source

pub fn client_with<P, C>( &mut self, select: impl for<'borrow> FnOnce(Pin<&'borrow D>) -> Pin<&'borrow P>, issue: impl for<'borrow> FnOnce(Context<'borrow, 'app, 'd, P>) -> C, ) -> C

Source

pub fn inspect<P, C>( &mut self, select: impl for<'borrow> FnOnce(Pin<&'borrow D>) -> Pin<&'borrow P>, inspect: impl for<'borrow> FnOnce(Pin<&'borrow P>) -> C, ) -> C

Trait Implementations§

Source§

impl<'app, 'life: 'app, 'd: 'life, D, Q> Deref for App<'app, 'life, 'd, D, Q>
where D: Layout<'d>,

Source§

type Target = Access<'app, 'life, 'd, D, Q>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'d, D: Layout<'d>, Q> DerefMut for App<'_, '_, 'd, D, Q>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'app, 'life, 'd, D, Q = ()> !RefUnwindSafe for App<'app, 'life, 'd, D, Q>

§

impl<'app, 'life, 'd, D, Q = ()> !Send for App<'app, 'life, 'd, D, Q>

§

impl<'app, 'life, 'd, D, Q = ()> !Sync for App<'app, 'life, 'd, D, Q>

§

impl<'app, 'life, 'd, D, Q = ()> !UnwindSafe for App<'app, 'life, 'd, D, Q>

§

impl<'app, 'life, 'd, D, Q> Freeze for App<'app, 'life, 'd, D, Q>
where Access<'app, 'life, 'd, D, Q>: Freeze,

§

impl<'app, 'life, 'd, D, Q> Unpin for App<'app, 'life, 'd, D, Q>
where Access<'app, 'life, 'd, D, Q>: Unpin,

§

impl<'app, 'life, 'd, D, Q> UnsafeUnpin for App<'app, 'life, 'd, D, Q>
where Access<'app, 'life, 'd, D, Q>: UnsafeUnpin,

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> Convert<T> for T

Source§

fn into(self) -> T

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.