pub struct KeyStore { /* private fields */ }Expand description
The personal keys visdom holds, one per console, project and account.
Implementations§
Source§impl KeyStore
impl KeyStore
pub fn at(path: PathBuf) -> KeyStore
Sourcepub fn lock(&self) -> Result<KeyStoreLock>
pub fn lock(&self) -> Result<KeyStoreLock>
Wait for this store to be free of every other visdom process, and
take it. Issuing a key revokes the previous one, so two sessions
starting together must not both issue: the second waits here and then
finds the first one’s key.
Sourcepub fn usable(
&self,
console_url: &str,
project_id: &str,
account: &str,
now: i64,
) -> Option<IssuedKey>
pub fn usable( &self, console_url: &str, project_id: &str, account: &str, now: i64, ) -> Option<IssuedKey>
The stored key of account for this console and project, when it has
at least MIN_KEY_SECONDS_LEFT left.
Sourcepub fn keep(
&self,
console_url: &str,
project_id: &str,
account: &str,
key: &IssuedKey,
now: i64,
) -> Result<(), String>
pub fn keep( &self, console_url: &str, project_id: &str, account: &str, key: &IssuedKey, now: i64, ) -> Result<(), String>
Keep key, replacing the one for the same console and project
(whoever’s it was: this machine’s user is now account) and dropping
keys that have expired. The file is the user’s alone.
Trait Implementations§
Auto Trait Implementations§
impl Forget for KeyStore
impl Freeze for KeyStore
impl Move for KeyStore
impl RefUnwindSafe for KeyStore
impl Send for KeyStore
impl Sync for KeyStore
impl Unpin for KeyStore
impl UnsafeUnpin for KeyStore
impl UnwindSafe for KeyStore
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