pub struct KeeperState {
pub version: u32,
pub updated_at_ms: u64,
pub accounts: BTreeMap<String, AccountState>,
}Fields§
§version: u32§updated_at_ms: u64§accounts: BTreeMap<String, AccountState>Implementations§
Source§impl KeeperState
impl KeeperState
Sourcepub fn entry(&mut self, identity: &AccountIdentity) -> &mut AccountState
pub fn entry(&mut self, identity: &AccountIdentity) -> &mut AccountState
Fetch or create the entry for identity. An existing entry (same
key) adopts the caller’s identity so that, for a seat-canonical key,
the recorded credential names the alias currently in use.
Sourcepub fn prune_idle(
&mut self,
keep: &[AccountIdentity],
now_ms: u64,
max_idle_ms: u64,
) -> Vec<String>
pub fn prune_idle( &mut self, keep: &[AccountIdentity], now_ms: u64, max_idle_ms: u64, ) -> Vec<String>
Prune entries that are NOT in keep, carry no attempt history, are
not mid-attempt, and have been idle longer than max_idle_ms.
Attempt ledgers are never deleted: an account temporarily excluded by
--account/--provider (or re-logged-in later with the same seat)
must find its spent generation intact, otherwise a filter switch could
burn a second activation. Returns the pruned keys.
Sourcepub fn due_among(&self, now_ms: u64, keys: &[String]) -> Vec<String>
pub fn due_among(&self, now_ms: u64, keys: &[String]) -> Vec<String>
due restricted to keys (the accounts a runner keeps).
Sourcepub fn next_wake_ms(&self) -> Option<u64>
pub fn next_wake_ms(&self) -> Option<u64>
Earliest next action across all accounts.
Sourcepub fn next_wake_among(&self, keys: &[String]) -> Option<u64>
pub fn next_wake_among(&self, keys: &[String]) -> Option<u64>
Earliest next action among keys.
Trait Implementations§
Source§impl Clone for KeeperState
impl Clone for KeeperState
Source§fn clone(&self) -> KeeperState
fn clone(&self) -> KeeperState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeeperState
impl Debug for KeeperState
Source§impl Default for KeeperState
impl Default for KeeperState
Source§fn default() -> KeeperState
fn default() -> KeeperState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KeeperState
impl<'de> Deserialize<'de> for KeeperState
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeeperState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<KeeperState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for KeeperState
impl PartialEq for KeeperState
Source§impl Serialize for KeeperState
impl Serialize for KeeperState
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for KeeperState
Auto Trait Implementations§
impl Freeze for KeeperState
impl RefUnwindSafe for KeeperState
impl Send for KeeperState
impl Sync for KeeperState
impl Unpin for KeeperState
impl UnsafeUnpin for KeeperState
impl UnwindSafe for KeeperState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.