pub struct AppState { /* private fields */ }Expand description
Shared, clonable gateway application state (config + policy + runtimes).
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(cfg: GatewayConfig) -> Result<AppState, WsPrismError>
pub fn new(cfg: GatewayConfig) -> Result<AppState, WsPrismError>
Build application state (config + compiled policies + runtimes).
Returns Result so the binary can surface startup errors without panic.
pub fn cfg(&self) -> &GatewayConfig
pub fn tenant_policy(&self, tenant_id: &str) -> Option<Arc<TenantPolicyRuntime>>
pub fn resolve_ticket(&self, ticket: &str) -> Result<String, WsPrismError>
pub fn realtime(&self) -> Arc<RealtimeCore>
pub fn dispatcher(&self) -> Arc<Dispatcher>
pub fn metrics(&self) -> Arc<GatewayMetrics>
pub fn handshake(&self) -> Arc<HandshakeDefender>
pub fn is_draining(&self) -> bool
Sourcepub fn enter_draining(&self)
pub fn enter_draining(&self)
Enter draining mode (idempotent).
Sourcepub fn metrics_extra(&self) -> Vec<(&'static str, u64)>
pub fn metrics_extra(&self) -> Vec<(&'static str, u64)>
Extra counters that are owned by other modules (egress drop/timeouts).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl !UnwindSafe for AppState
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
Mutably borrows from an owned value. Read more