pub struct AppState { /* private fields */ }Expand description
Shared application state. Cheap to clone (an Arc); holds the registry root,
the resolved master key (zeroized on drop via MasterKey), the ephemeral
session token, and the last-activity instant for the idle watchdog.
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(
root: PathBuf,
master: MasterKey,
confirmer: Arc<dyn Confirmer + Send + Sync>,
) -> Self
pub fn new( root: PathBuf, master: MasterKey, confirmer: Arc<dyn Confirmer + Send + Sync>, ) -> Self
Build state for a registry root, a resolved master key, and the
attended-confirmation confirmer, minting a fresh random session token
(128 bits of hex). The token dies with the process — it is never
persisted.
Sourcepub fn new_with_session(
root: PathBuf,
master: MasterKey,
session_token: String,
confirmer: Arc<dyn Confirmer + Send + Sync>,
) -> Self
pub fn new_with_session( root: PathBuf, master: MasterKey, session_token: String, confirmer: Arc<dyn Confirmer + Send + Sync>, ) -> Self
Like AppState::new but with a caller-supplied session token. Used by
the L11 container entrypoint so the host orchestrator (kovra ui --docker) — which generated the token and built the browser URL — and
the in-container server agree on it.
Sourcepub fn session_token(&self) -> &str
pub fn session_token(&self) -> &str
The ephemeral session token (embedded into the page URL by kovra ui).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Freeze for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin 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