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 AccountCachewhere
*const LeafNode<String, CachedAccount> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, CachedAccount)>>: Freeze,
impl Move for AccountCache
impl RefUnwindSafe for AccountCache
impl Send for AccountCachewhere
NodeRef<Owned, String, CachedAccount, LeafOrInternal>: Send,
BoxRaw<(String, CachedAccount)>: Send,
impl Sync for AccountCachewhere
NodeRef<Owned, String, CachedAccount, LeafOrInternal>: Sync,
BoxRaw<(String, CachedAccount)>: Sync,
impl Unpin for AccountCache
impl UnsafeUnpin for AccountCachewhere
*const LeafNode<String, CachedAccount> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, CachedAccount)>>: UnsafeUnpin,
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
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§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.