pub struct GatewayState {
pub tenants: RwLock<HashMap<TenantId, TenantState>>,
pub metrics: Arc<GatewayMetrics>,
pub token_provider: HashTokenProvider,
/* private fields */
}Expand description
Central, thread-safe, multi-tenant state repository for the Gateway capability.
Fields§
§tenants: RwLock<HashMap<TenantId, TenantState>>Partitioned tenant maps containing client/worker connections and resolver tables.
metrics: Arc<GatewayMetrics>Live telemetry and performance counters.
token_provider: HashTokenProviderToken provider for cryptographic authentication checks.
Implementations§
Source§impl GatewayState
impl GatewayState
Sourcepub fn new(
config: GatewayConfig,
token_provider: HashTokenProvider,
) -> GatewayResult<Self>
pub fn new( config: GatewayConfig, token_provider: HashTokenProvider, ) -> GatewayResult<Self>
Validates configuration and instantiates the central Gateway state.
Sourcepub fn with_replay_store(
config: GatewayConfig,
token_provider: HashTokenProvider,
connection_replay: Arc<dyn PeerNonceStore>,
) -> GatewayResult<Self>
pub fn with_replay_store( config: GatewayConfig, token_provider: HashTokenProvider, connection_replay: Arc<dyn PeerNonceStore>, ) -> GatewayResult<Self>
Creates state with an explicit replay store shared by every accepted connection for this Gateway instance.
Sourcepub fn config(&self) -> &GatewayConfig
pub fn config(&self) -> &GatewayConfig
Returns the validated immutable service configuration.
Sourcepub fn request_shutdown(&self)
pub fn request_shutdown(&self)
Requests cooperative termination of all Gateway-owned background work and active connection loops.
Sourcepub fn is_shutting_down(&self) -> bool
pub fn is_shutting_down(&self) -> bool
Reports whether cooperative shutdown has been requested.
Auto Trait Implementations§
impl !Freeze for GatewayState
impl !RefUnwindSafe for GatewayState
impl !UnwindSafe for GatewayState
impl Send for GatewayState
impl Sync for GatewayState
impl Unpin for GatewayState
impl UnsafeUnpin for GatewayState
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