application

Root initialization and application lifetime, independent of any async executor.

Structs

AppClosed

Completion of retained application cleanup. This observer does not own the application and never blocks the UI thread.


AppContext

Weak access to the application that owns a node. Cloning this context does not keep an application active. This context stays local and provides no dependency lookup.

Implementations

async_scope
pub fn async_scope(&self) -> Result<AsyncScope, AsyncError>

Application lifetime, independent of individual mounted views.

closed
pub fn closed(&self) -> AppClosed

Observe disposal completion without driving cleanup. The host's wake scheduler keeps cleanup progressing even when this future is not polled.

id
pub fn id(&self) -> Option<u64>

Process-local identity of this application instance while retained.

phase
pub fn phase(&self) -> AppPhase

Current lifecycle state; a released owner reports Closed.

set_task_error_sink
pub fn set_task_error_sink(&self, sink: impl Fn(String) + 'static) -> Result<(), AsyncError>

Observe unhandled task panics on the UI thread, including dropped controls. Reporting continues while managed shutdown retains the application. The sink must not touch detached UI state once the phase is Closing.

target
pub fn target(&self) -> Result<TargetInfo, AsyncError>

Target facts selected by the owning host.


AppOptions

Resource limits and cleanup diagnostics for one application instance. These options never construct an executor or register application services.

Properties

async_limits

Type: AsyncLimits

startup_data

Type: Vec<u8>

Opaque application-defined bytes, copied by the host before preparation. At most [HOST_MESSAGE_LIMIT] bytes. Pax does not choose their encoding.

shutdown_deadline

Type: Duration

Diagnostic deadline only; unfinished cleanup retains its dependencies.


InitContext

Context supplied to the ordinary root initializer on the UI owner thread. The application's property graph is entered for the duration of the call. Construct the root promptly, then use scoped work for asynchronous loading.

Properties

target

Type: TargetInfo

Implementations

lifetime
pub fn lifetime(&self) -> &AppContext

Cancellation and retained cleanup boundary for explicitly owned executors.

on_host_request
pub fn on_host_request(&self, handler: impl Fn(Vec<u8>) -> AppResult<Vec<u8>> + 'static) -> AppResult

Install the application's one host request handler during initialization. Requests run on the UI owner through the scoped delivery queue after activation. Return promptly; start scoped async work for longer operations. Requests and replies are bounded byte buffers with an app-defined encoding. Closing cancels queued requests. The handler is released before cleanup.

startup_data
pub fn startup_data(&self) -> &[u8]

Read application-defined startup bytes. Decode and validate them in the initializer; the host never receives access to the resulting Rust values.

Enums

AppPhase

The activation and teardown state of one cartridge instance.

Variants

Preparing
Active
Closing
Closed

StopReason

Why an application is leaving its active host.

Variants

HostClosed
Replaced
PreparationDiscarded

Type Aliases

AppResult

A fallible application configuration result.

Constants

HOST_MESSAGE_LIMIT

Maximum encoded startup, request or reply size across a host boundary.