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
impl Application
Sourcepub fn boot(config: &FrameConfig, spec: AppSpec) -> Result<Self, HostError>
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.
Sourcepub fn serve(
&self,
config: &FrameConfig,
page: PageServer,
external_stop: impl Future<Output = ()> + Send + 'static,
) -> Result<ServeStop, HostError>
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.
Sourcepub fn shutdown(self) -> Result<(), HostError>
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§
impl !Freeze for Application
impl !RefUnwindSafe for Application
impl !UnwindSafe for Application
impl Send for Application
impl Sync for Application
impl Unpin for Application
impl UnsafeUnpin for Application
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request