Skip to main content

App

Trait App 

Source
pub unsafe trait App<'d>: Sized + Layout<'d> {
    const ROUTES: Routes;
    const DISPATCH_ROUTES: Routes = Self::ROUTES;
    const WAKE_ROUTES: Routes = settings::Routes::EMPTY;
    const COORDS: usize = 0;
    const PARK: bool = false;

    // Provided methods
    fn census(_: Pin<&Self>, counts: &mut Census) -> Option<()> { ... }
    unsafe fn sweep<'app, 'driver, 'turn>(
        app: Pin<&'app mut Self>,
        sweep: &mut Sweep<'driver, 'turn, 'd, impl Report>,
    )
       where 'd: 'driver + 'turn { ... }
    unsafe fn park<'app, 'driver, 'turn>(
        _: Pin<&'app mut Self>,
        _: Turn<'turn, 'd>,
        _: &'driver mut Lifecycle<'d, impl Report>,
    )
       where 'd: 'driver + 'turn { ... }
    fn admit(_: Pin<&Self>, needs: &mut Needs) -> Result<(), Claim> { ... }
    unsafe fn released(_: Pin<&mut Self>) { ... }
    fn install(_: Pin<&mut Self>, _: Install<'_, 'd>) { ... }
    unsafe fn activate<'app, 'driver, 'turn>(
        _: Pin<&'app mut Self>,
        _: Erased<'d, Any>,
        _: Turn<'turn, 'd>,
        _: &'driver mut Lifecycle<'d, impl Report>,
    ) -> bool
       where 'd: 'driver + 'turn { ... }
    fn has_dispatch_owner(_: Pin<&Self>, route: Route) -> bool { ... }
    fn dispatch<'event>(
        _: Pin<&mut Self>,
        event: Dispatch<'event, 'd, Self::Scope>,
        _: Turn<'_, 'd>,
        _: &mut Lifecycle<'d, impl Report>,
    ) -> ControlFlow<Dispatch<'event, 'd, Self::Scope>> { ... }
    fn progress<const STOP: bool>(
        _: Pin<&Self>,
        _: Progress<'_, '_, 'd>,
        _: Option<&mut Waits<'d>>,
    ) -> ControlFlow<()> { ... }
    fn shutdown(
        _: Pin<&mut Self>,
        _: Turn<'_, 'd>,
        _: &mut Lifecycle<'d, impl Report>,
    ) { ... }
    fn finish(
        _: Pin<&mut Self>,
        _: Install<'_, 'd>,
        _: &mut Finish<'_, 'd, impl Report>,
    ) { ... }
}
Expand description

§Safety

Visit each owner once through unchanged pinned projections, presence, and operation authority. Admission includes every present owner’s route, without merging duplicate owners. Keep the root pinned; shutdown preserves client storage and finish destroys dependents before providers. A fixed Scope names this owner’s admitted completion route. ParkPlan = () runs park directly; Flat runs the unchanged census/sweep traversal.

Required Associated Constants§

Provided Associated Constants§

Source

const DISPATCH_ROUTES: Routes = Self::ROUTES

Routes on which a nested application may observe a completion.

Source

const WAKE_ROUTES: Routes = settings::Routes::EMPTY

Routes whose installed owners may receive activation.

Source

const COORDS: usize = 0

Upper bound on idle coordinator probes, including delegated probes.

Source

const PARK: bool = false

Provided Methods§

Source

fn census(_: Pin<&Self>, counts: &mut Census) -> Option<()>

Source

unsafe fn sweep<'app, 'driver, 'turn>( app: Pin<&'app mut Self>, sweep: &mut Sweep<'driver, 'turn, 'd, impl Report>, )
where 'd: 'driver + 'turn,

§Safety

Traverse the same admitted pinned owners in their census order.

Source

unsafe fn park<'app, 'driver, 'turn>( _: Pin<&'app mut Self>, _: Turn<'turn, 'd>, _: &'driver mut Lifecycle<'d, impl Report>, )
where 'd: 'driver + 'turn,

§Safety

The exact pinned root is installed and admitted. Run this leaf’s work or this aggregate’s own coordinator with the same driver and turn.

Source

fn admit(_: Pin<&Self>, needs: &mut Needs) -> Result<(), Claim>

Accumulates the routes of the owners actually present in this pinned root.

Source

unsafe fn released(_: Pin<&mut Self>)

§Safety

All external clients of this exact pinned owner have ended.

Source

fn install(_: Pin<&mut Self>, _: Install<'_, 'd>)

Source

unsafe fn activate<'app, 'driver, 'turn>( _: Pin<&'app mut Self>, _: Erased<'d, Any>, _: Turn<'turn, 'd>, _: &'driver mut Lifecycle<'d, impl Report>, ) -> bool
where 'd: 'driver + 'turn,

Returns whether a present owner handled this activation. On false, the caller may continue through the remaining owners of the same root.

§Safety

Use this exact installed pinned root, driver and turn, with a target belonging to the same driver and declared by WAKE_ROUTES.

Source

fn has_dispatch_owner(_: Pin<&Self>, route: Route) -> bool

Resolves overlapping candidate routes against the receivers actually installed in this root.

Source

fn dispatch<'event>( _: Pin<&mut Self>, event: Dispatch<'event, 'd, Self::Scope>, _: Turn<'_, 'd>, _: &mut Lifecycle<'d, impl Report>, ) -> ControlFlow<Dispatch<'event, 'd, Self::Scope>>

A selected receiver consumes the completion or returns it to the driver.

Source

fn progress<const STOP: bool>( _: Pin<&Self>, _: Progress<'_, '_, 'd>, _: Option<&mut Waits<'d>>, ) -> ControlFlow<()>

Reports waits into the same traversal until an owner can run immediately.

Source

fn shutdown( _: Pin<&mut Self>, _: Turn<'_, 'd>, _: &mut Lifecycle<'d, impl Report>, )

Source

fn finish( _: Pin<&mut Self>, _: Install<'_, 'd>, _: &mut Finish<'_, 'd, impl Report>, )

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'d> App<'d> for ()

Source§

const ROUTES: Routes = settings::Routes::EMPTY

Implementors§

Source§

impl<'app, 'd, H, T> App<'d> for Bound<'app, 'd, H, T>
where Borrowed<'app, H>: App<'d>, Owner<ManuallyDrop<T>, T>: App<'d>,

SAFETY: each lifecycle operation visits all declared owners once, through the same pinned projections and presence in the declared lifecycle order. The root stays pinned through finish and retains each operation’s authority.

Source§

impl<'d, A, B> App<'d> for Pair<'d, A, B>
where A: App<'d> + Root<'d>, B: App<'d> + Root<'d>,

SAFETY: each lifecycle operation visits all declared owners once, through the same pinned projections and presence in the declared lifecycle order. The root stays pinned through finish and retains each operation’s authority.

Source§

impl<'d, S, T> App<'d> for Owner<S, T>
where S: Project<App = T>, T: App<'d>,

Source§

const ROUTES: Routes = T::ROUTES

Source§

const DISPATCH_ROUTES: Routes = T::DISPATCH_ROUTES

Source§

const WAKE_ROUTES: Routes = T::WAKE_ROUTES

Source§

const COORDS: usize

Source§

const PARK: bool = T::PARK