pub struct TerminalCache { /* private fields */ }Expand description
Terminal cache for storing expensive computations
Implementations§
Source§impl TerminalCache
impl TerminalCache
Sourcepub fn get_sys_info(&self) -> Option<SysInfo>
pub fn get_sys_info(&self) -> Option<SysInfo>
Get cached system info if not expired (TTL: 5 seconds)
Sourcepub fn set_sys_info(&self, info: SysInfo)
pub fn set_sys_info(&self, info: SysInfo)
Cache system info
Sourcepub fn get_mining_info(&self) -> Option<MiningInfo>
pub fn get_mining_info(&self) -> Option<MiningInfo>
Get cached mining info if not expired (TTL: 10 seconds)
Sourcepub fn set_mining_info(&self, info: MiningInfo)
pub fn set_mining_info(&self, info: MiningInfo)
Cache mining info
Sourcepub fn get_tx_pool_info(&self) -> Option<TerminalPoolInfo>
pub fn get_tx_pool_info(&self) -> Option<TerminalPoolInfo>
Get cached transaction pool info if not expired (TTL: 2 seconds)
Sourcepub fn set_tx_pool_info(&self, info: TerminalPoolInfo)
pub fn set_tx_pool_info(&self, info: TerminalPoolInfo)
Cache transaction pool info
Sourcepub fn get_cells_info(&self) -> Option<CellsInfo>
pub fn get_cells_info(&self) -> Option<CellsInfo>
Get cached cells info if not expired (TTL: 30 seconds)
Sourcepub fn set_cells_info(&self, info: CellsInfo)
pub fn set_cells_info(&self, info: CellsInfo)
Cache cells info
Sourcepub fn get_network_info(&self) -> Option<NetworkInfo>
pub fn get_network_info(&self) -> Option<NetworkInfo>
Get cached network info if not expired (TTL: 10 seconds)
Sourcepub fn set_network_info(&self, info: NetworkInfo)
pub fn set_network_info(&self, info: NetworkInfo)
Cache network info
Sourcepub fn clear_specific(&self, refresh: RefreshKind)
pub fn clear_specific(&self, refresh: RefreshKind)
Clear specific cache entry types based on refresh flags
Trait Implementations§
Source§impl Clone for TerminalCache
impl Clone for TerminalCache
Source§fn clone(&self) -> TerminalCache
fn clone(&self) -> TerminalCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TerminalCache
impl !RefUnwindSafe for TerminalCache
impl Send for TerminalCache
impl Sync for TerminalCache
impl Unpin for TerminalCache
impl UnsafeUnpin for TerminalCache
impl !UnwindSafe for TerminalCache
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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