Skip to main content

Application

Struct Application 

Source
pub struct Application { /* private fields */ }
Expand description

A booted application stack: the component runtime with the application’s components running, the embedded bus, the optional document binding, and the application-event announcer (absent — loudly — only when the config declares no [frame].channel).

Implementations§

Source§

impl Application

Source

pub fn boot(config: &FrameConfig, spec: AppSpec) -> Result<Self, HostError>

Boots the full stack around the application’s spec, in order. A boot failure tears down whatever already booted so no component is left running; the first typed failure is what gets reported.

§Errors

Returns the first typed failure from spec validation, runtime composition, component install, the application’s readiness proof, the embedded bus boot, the document binding, the announcer connect (a typed boot failure — never a silently event-less page), or the application’s fact announcements.

Source

pub fn serve( &self, config: &FrameConfig, page: PageServer, external_stop: impl Future<Output = ()> + Send + 'static, ) -> Result<ServeStop, HostError>

Serves the page until SIGTERM, SIGINT, external_stop resolving, or a bus liveness failure — blocking.

SERVE-ORDER FIX (2026-07-21 boot-visibility fix, crate::truth): the HTTP+WS surface binds FIRST; the announcer pump only starts draining its retained boot backlog (transitions, then queued facts, then live events) once that surface is reachable. Before this fix the pump started as this function’s first action — before the tokio runtime even existed — so the entire backlog drained before /frame/config.json (the only doctrine-sanctioned way a browser discovers the bus address) was fetchable at all; no real browser could ever win that race. /frame/app/status.json (also served the instant this binds) closes the remaining gap: a client that still arrives after the live drain observes the full boot history there instead of racing the bus.

§Errors

Returns typed failures from binding the page server, starting the announcer pump, building the async runtime, registering signal handlers, or the accept loop. The caller still owns the stack and must drive Self::shutdown.

Source

pub fn shutdown(self) -> Result<(), HostError>

Ordered teardown, always running every step and hiding no failure: announcer intake closes first, the document binding stops (its pump rides the bus), the components stop and remove in order (their transitions publish through the still-connected announcer, whose pump exits on the final Removed), the announcer joins, then the bus drains gracefully.

§Errors

Returns the first typed teardown failure by stage precedence (document, components, announcer, bus); every later failure is still executed and logged before the first is returned.

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more