Skip to main content

App

Trait App 

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

    // Required methods
    fn select_park() -> Option<Self::ParkPlan>;
    unsafe fn park<'app, 'driver, 'turn>(
        app: Pin<&'app mut Self>,
        plan: &mut Self::ParkPlan,
        park: Park<'driver, 'turn, 'd>,
    )
       where 'd: 'driver + 'turn;
    fn progress(app: Pin<&Self>, view: Progress<'_, '_, 'd>) -> Progress<'d>;
    fn stopping(app: Pin<&Self>, view: Progress<'_, '_, 'd>) -> Progress<'d>;

    // Provided methods
    fn prepare_park(_: Pin<&Self>, _: &mut Self::ParkPlan) -> Option<Count> { ... }
    fn admit(_: Pin<&Self>, needs: &mut Needs) -> Result<(), Claim> { ... }
    fn released(released: Released<'_, Self>) -> Released<'_, Self> { ... }
    fn install<'app, 'owner>(
        install: Install<'app, 'owner, 'd, Self>,
    ) -> Install<'app, 'owner, 'd, Self> { ... }
    unsafe fn activate<'app, 'driver, 'turn>(
        _: Pin<&'app mut Self>,
        _: Activate<'driver, 'turn, 'd>,
    ) -> bool
       where 'd: 'driver + 'turn { ... }
    fn dispatch<'app, 'driver, 'turn>(
        call: Dispatch<'app, 'driver, 'turn, 'd, Self>,
    ) -> ControlFlow<Event<'d>> { ... }
    fn shutdown<'app, 'turn, 'driver>(
        shutdown: Shutdown<'app, 'turn, 'driver, 'd, Self>,
    ) -> Shutdown<'app, 'turn, 'driver, 'd, Self> { ... }
    fn finish<'app, 'finish, 'owner, 'epoch>(
        finish: Finish<'app, 'finish, 'owner, 'epoch, 'd, Self>,
    ) -> Finish<'app, 'finish, 'owner, 'epoch, 'd, Self> { ... }
}
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.

Required Associated Constants§

Source

const ROUTES: Routes

Source

const COORDS: usize

Upper bound on idle coordinator probes, including delegated probes.

Provided Associated Constants§

Source

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

Routes whose installed owners may receive activation.

Required Methods§

Source

fn select_park() -> Option<Self::ParkPlan>

Source

unsafe fn park<'app, 'driver, 'turn>( app: Pin<&'app mut Self>, plan: &mut Self::ParkPlan, park: Park<'driver, 'turn, 'd>, )
where 'd: 'driver + 'turn,

§Safety

The exact pinned root is installed and this plan completed preparation and admission for that root. The park authority belongs to the same root.

Source

fn progress(app: Pin<&Self>, view: Progress<'_, '_, 'd>) -> Progress<'d>

Source

fn stopping(app: Pin<&Self>, view: Progress<'_, '_, 'd>) -> Progress<'d>

Provided Methods§

Source

fn prepare_park(_: Pin<&Self>, _: &mut Self::ParkPlan) -> Option<Count>

Prepares the selected coordinator shares once after installation. The count does not exceed COORDS; field presence and shares remain stable through finish. None reports count overflow.

Source

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

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

Source

fn released(released: Released<'_, Self>) -> Released<'_, Self>

Source

fn install<'app, 'owner>( install: Install<'app, 'owner, 'd, Self>, ) -> Install<'app, 'owner, 'd, Self>

Source

unsafe fn activate<'app, 'driver, 'turn>( _: Pin<&'app mut Self>, _: Activate<'driver, 'turn, 'd>, ) -> 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

The activation retains this exact installed pinned root and a target declared by WAKE_ROUTES.

Source

fn dispatch<'app, 'driver, 'turn>( call: Dispatch<'app, 'driver, 'turn, 'd, Self>, ) -> ControlFlow<Event<'d>>

Source

fn shutdown<'app, 'turn, 'driver>( shutdown: Shutdown<'app, 'turn, 'driver, 'd, Self>, ) -> Shutdown<'app, 'turn, 'driver, 'd, Self>

Source

fn finish<'app, 'finish, 'owner, 'epoch>( finish: Finish<'app, 'finish, 'owner, 'epoch, 'd, Self>, ) -> Finish<'app, 'finish, 'owner, 'epoch, 'd, Self>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

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

Source§

impl<'app, 'd, H, T> App<'d> for dope_runtime::topology::lending::raw::Pair<'app, 'd, H, T>
where Owner<Pin<&'app mut H>, H>: App<'d>, Owner<ManuallyDrop<T>, T>: App<'d>,

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

Source§

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

SAFETY: each lifecycle operation visits all declared owners once, in declaration order, through the same pinned projections and presence. 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>, Self: Finishes<'d, Self>,

Source§

const ROUTES: Routes = T::ROUTES

Source§

const WAKE_ROUTES: Routes = T::WAKE_ROUTES

Source§

const COORDS: usize