pub struct ServerState {
pub repo_root: PathBuf,
pub host: Arc<MissionHost>,
pub bind_addr: Option<SocketAddr>,
pub bind_is_loopback: bool,
}Expand description
Shared handler state: the repo root for the read-only routes (all mission data is re-read from disk per request) plus the hosted-engine registry.
Fields§
§repo_root: PathBuf§host: Arc<MissionHost>Shared (Arc) so kranz serve --slack can hand the SAME registry to
the Slack bridge: web and Slack are two clients of one set of live
engines, never two engines fighting over one mission lock.
bind_addr: Option<SocketAddr>Serve bind address threaded into CORS / WS origin checks. None
keeps the test/back-compat wildcard (any loopback host, any port).
bind_is_loopback: boolWhether the serve bind is loopback. Loopback keeps the strict browser origin allowlist on the WS upgrade (reads are tokenless there, so the Origin check is the guard); off loopback the read token authenticates and IP-literal / missing origins are accepted.
Auto Trait Implementations§
impl !RefUnwindSafe for ServerState
impl !UnwindSafe for ServerState
impl Freeze for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl UnsafeUnpin for ServerState
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