pub struct AccountCache {
pub entries: BTreeMap<String, CachedAccount>,
}Expand description
Integration id -> its last answer.
Fields§
§entries: BTreeMap<String, CachedAccount>Implementations§
Source§impl AccountCache
impl AccountCache
Sourcepub fn get(&self, id: &str, query_hash: &str) -> Option<&CachedAccount>
pub fn get(&self, id: &str, query_hash: &str) -> Option<&CachedAccount>
The entry of id when it answers the same question, whatever its age
(a caller shows it while it refreshes).
Sourcepub fn fresh(
&self,
id: &str,
query_hash: &str,
now: u64,
) -> Option<&CachedAccount>
pub fn fresh( &self, id: &str, query_hash: &str, now: u64, ) -> Option<&CachedAccount>
Self::get restricted to entries younger than ACCOUNT_TTL.
Trait Implementations§
Source§impl Clone for AccountCache
impl Clone for AccountCache
Source§impl Debug for AccountCache
impl Debug for AccountCache
Source§impl Default for AccountCache
impl Default for AccountCache
impl Eq for AccountCache
Source§impl PartialEq for AccountCache
impl PartialEq for AccountCache
impl StructuralPartialEq for AccountCache
Auto Trait Implementations§
impl Forget for AccountCache
impl Freeze for AccountCache
impl Move for AccountCache
impl RefUnwindSafe for AccountCache
impl Send for AccountCache
impl Sync for AccountCache
impl Unpin for AccountCache
impl UnsafeUnpin for AccountCache
impl UnwindSafe for AccountCache
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.