pub struct VaultState { /* private fields */ }Expand description
Vault SSH certificate and signing state.
Implementations§
Source§impl VaultState
impl VaultState
pub fn cert_cache( &self, ) -> &HashMap<String, (Instant, CertStatus, Option<SystemTime>)>
pub fn cert_entry( &self, alias: &str, ) -> Option<&(Instant, CertStatus, Option<SystemTime>)>
pub fn has_cert(&self, alias: &str) -> bool
pub fn insert_cert( &mut self, alias: String, entry: (Instant, CertStatus, Option<SystemTime>), )
pub fn remove_cert(&mut self, alias: &str)
pub fn clear_cert_cache(&mut self)
pub fn is_cert_check_in_flight(&self, alias: &str) -> bool
pub fn take_cleanup_warning(&mut self) -> Option<String>
pub fn signing_cancel(&self) -> Option<&Arc<AtomicBool>>
pub fn is_signing(&self) -> bool
pub fn set_signing_cancel(&mut self, cancel: Arc<AtomicBool>)
pub fn clear_signing_cancel(&mut self)
pub fn set_sign_thread(&mut self, handle: JoinHandle<()>)
pub fn sign_in_flight(&self) -> &Arc<Mutex<HashSet<String>>>
pub fn pending_config_write(&self) -> bool
pub fn set_pending_config_write(&mut self, value: bool)
Sourcepub fn pending_sign(&self) -> Option<&[VaultSignTarget]>
pub fn pending_sign(&self) -> Option<&[VaultSignTarget]>
Read the precomputed signable list for an open
Screen::ConfirmVaultSign dialog. None when no dialog is
open.
Sourcepub fn set_pending_sign(&mut self, signable: Vec<VaultSignTarget>)
pub fn set_pending_sign(&mut self, signable: Vec<VaultSignTarget>)
Install a fresh signable list. Caller transitions the screen.
Sourcepub fn take_pending_sign(&mut self) -> Option<Vec<VaultSignTarget>>
pub fn take_pending_sign(&mut self) -> Option<Vec<VaultSignTarget>>
Drop the signable list, returning it for use by the confirm-yes handler.
Sourcepub fn prune_orphans(&mut self, valid_aliases: &HashSet<&str>)
pub fn prune_orphans(&mut self, valid_aliases: &HashSet<&str>)
Drop cert-cache, in-flight check, and bulk-sign in-flight entries
whose alias is no longer in valid_aliases. Called from
App::reload_hosts after the new host list lands. Recovers from a
poisoned sign_in_flight mutex by reading the inner set: a
poisoned worker still owns live aliases that must not be wiped.
Sourcepub fn migrate_alias(&mut self, old: &str, new: &str)
pub fn migrate_alias(&mut self, old: &str, new: &str)
Move cert_checks_in_flight and sign_in_flight entries from
old to new. cert_cache is excluded by design: a host
rename invalidates the prior cert path, so the caller is
expected to refresh the cache rather than migrate the entry.
Recovers from a poisoned sign_in_flight mutex. No-op when
old == new.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VaultState
impl !RefUnwindSafe for VaultState
impl Send for VaultState
impl Sync for VaultState
impl Unpin for VaultState
impl UnsafeUnpin for VaultState
impl !UnwindSafe for VaultState
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more