pub struct ActiveStore { /* private fields */ }Expand description
Which store is in use, and whether that is the one the configured start mode obliges.
05-infrastructure.md requires the start mode to be visible in host show
and in TUI host settings, and requires service status to say when
--start-at login means the agent does not run until the operator logs in.
This is the value both of those print. It exists as a type rather than as a
formatted string in two places so that the two cannot drift.
ActiveStore::agrees_with_start_mode is the check worth having: the store
a process opened and the start mode recorded for the installed service are
two independently persisted facts, and a host whose service was switched
from boot to login without the token being moved is a host whose daemon
will start and then fail to find a credential. Saying so in service status
is cheaper than finding out at three in the morning.
Implementations§
Source§impl ActiveStore
impl ActiveStore
Sourcepub fn of(store: &dyn SecretStore, start_mode: StartMode) -> Self
pub fn of(store: &dyn SecretStore, start_mode: StartMode) -> Self
Pairs a store with the start mode currently configured for the service.
Sourcepub const fn scope(&self) -> SecretScope
pub const fn scope(&self) -> SecretScope
The store in use.
Sourcepub const fn start_mode(&self) -> StartMode
pub const fn start_mode(&self) -> StartMode
The start mode configured for the service.
Sourcepub fn agrees_with_start_mode(&self) -> bool
pub fn agrees_with_start_mode(&self) -> bool
Whether the store in use is the one this start mode obliges.
Trait Implementations§
Source§impl Clone for ActiveStore
impl Clone for ActiveStore
Source§fn clone(&self) -> ActiveStore
fn clone(&self) -> ActiveStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more