pub struct EmbeddedLiminal { /* private fields */ }Expand description
A booted, live embedded liminal component: the TCP listener, the browser WebSocket listener, and the health endpoint, all bound and serving on liminal’s own threads inside the frame-host process.
Holding this value keeps the component alive. Self::shutdown drives
liminal’s own graceful teardown; dropping it without calling shutdown still
stops every listener thread via each handle’s Drop (no leaked threads).
Implementations§
Source§impl EmbeddedLiminal
impl EmbeddedLiminal
Sourcepub fn boot(config: &ServerConfig) -> Result<Self, HostError>
pub fn boot(config: &ServerConfig) -> Result<Self, HostError>
Boots the embedded liminal component from the validated [bus]
config: health endpoint, full-profile services, TCP listener, and the
browser WebSocket listener — each bound before the next.
The caller (crate::config::FrameConfig::load) has already validated
the config and refused any embedded-unsupported shape, so [websocket]
is guaranteed present here.
§Errors
Returns HostError::LiminalComponent naming the exact component that
failed to bind or boot. Every already-bound component is torn down by its
own Drop as the error unwinds, so a failed boot never leaves a listener
behind — there is no half-up state.
Sourcepub fn websocket_endpoint(&self) -> String
pub fn websocket_endpoint(&self) -> String
The browser-facing WebSocket endpoint, derived from the ACTUAL bound listener address plus the configured upgrade path.
This is the single source of truth surfaced to the page as
busEndpoint (and, during the compatibility window, as the deprecated
duplicate liminalEndpoint): because it comes from the live listener’s own
local_addr, the page’s endpoint and the server’s real bound address are
one value and can never drift.
Sourcepub const fn tcp_addr(&self) -> SocketAddr
pub const fn tcp_addr(&self) -> SocketAddr
The bound TCP wire listener address (native clients, e.g. the demo publisher, connect here).
Sourcepub const fn websocket_addr(&self) -> SocketAddr
pub const fn websocket_addr(&self) -> SocketAddr
The bound browser WebSocket listener address.
Sourcepub const fn health_addr(&self) -> SocketAddr
pub const fn health_addr(&self) -> SocketAddr
The bound health endpoint address.
Sourcepub fn shutdown(self) -> Result<(), HostError>
pub fn shutdown(self) -> Result<(), HostError>
Drives liminal’s own graceful shutdown: stop accepting on both transports, drain/force-close active connections, flush durable state, then stop the health endpoint.
§Errors
Returns HostError::LiminalShutdown if liminal’s drain/flush fails, or
HostError::LiminalComponent if the health endpoint fails to stop.
Auto Trait Implementations§
impl !RefUnwindSafe for EmbeddedLiminal
impl !UnwindSafe for EmbeddedLiminal
impl Freeze for EmbeddedLiminal
impl Send for EmbeddedLiminal
impl Sync for EmbeddedLiminal
impl Unpin for EmbeddedLiminal
impl UnsafeUnpin for EmbeddedLiminal
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