pub struct SharedState {
pub keys: Arc<KeyRegistry>,
pub admin: Arc<AdminTokenStore>,
pub registry: Arc<TunnelRegistry>,
pub config: ServerConfig,
pub tls: Arc<ServerConfig>,
pub apex: Option<String>,
pub https_bind: Option<SocketAddr>,
pub rates: Arc<RateTable>,
pub peers: Arc<PeerRegistry>,
pub peer_lookup: Mutex<Arc<dyn PeerLabelLookup>>,
pub metrics: Arc<ServerMetrics>,
}Expand description
Everything a worker thread needs from the parent to run an accept loop.
Fields§
§keys: Arc<KeyRegistry>§admin: Arc<AdminTokenStore>§registry: Arc<TunnelRegistry>§config: ServerConfig§tls: Arc<ServerConfig>§apex: Option<String>§https_bind: Option<SocketAddr>§rates: Arc<RateTable>§9 per-identity rate-limit state. Populated lazily at handshake
time; entries are keyed by PubKey.
peers: Arc<PeerRegistry>§16.3.2 static federated-peer list. Hot-reloaded on file change.
peer_lookup: Mutex<Arc<dyn PeerLabelLookup>>§16.3.4 peer-label lookup oracle. Defaults to
NoOpPeerLookup — real deployments plug in an HTTP client
against peer §16.4 admin APIs via
Server::with_peer_lookup. Wrapped in a Mutex so
with_peer_lookup can swap the inner Arc after
SharedState has already been shared with the accept loop.
metrics: Arc<ServerMetrics>Process-wide counters + gauges surfaced on
/admin/v1/metrics. Every code path that observes a
countable event (auth success/failure, session outcome,
resume attempt, rate-limit trip, tunnel registration, admin
API call) does an Ordering::Relaxed fetch-add on the
corresponding atomic here.