Struct vapcore_light::cache::Cache[][src]

pub struct Cache { /* fields omitted */ }

The light client data cache.

Note that almost all getter methods take &mut self due to the necessity to update the underlying LRU-caches on read. LRU-cache

Implementations

impl Cache[src]

pub fn new(sizes: CacheSizes, corpus_expiration: Duration) -> Self[src]

Create a new data cache with the given sizes and gas price corpus expiration time.

pub fn block_header(&mut self, hash: &H256) -> Option<Header>[src]

Query header by hash.

pub fn block_hash(&mut self, num: BlockNumber) -> Option<H256>[src]

Query hash by number.

pub fn block_body(&mut self, hash: &H256) -> Option<Body>[src]

Query block body by block hash.

pub fn block_receipts(&mut self, hash: &H256) -> Option<Vec<Receipt>>[src]

Query block receipts by block hash.

pub fn chain_score(&mut self, hash: &H256) -> Option<U256>[src]

Query chain score by block hash.

pub fn insert_block_header(&mut self, hash: H256, hdr: Header)[src]

Cache the given header.

pub fn insert_block_hash(&mut self, num: BlockNumber, hash: H256)[src]

Cache the given canonical block hash.

pub fn insert_block_body(&mut self, hash: H256, body: Body)[src]

Cache the given block body.

pub fn insert_block_receipts(&mut self, hash: H256, receipts: Vec<Receipt>)[src]

Cache the given block receipts.

pub fn insert_chain_score(&mut self, hash: H256, score: U256)[src]

Cache the given chain scoring.

pub fn gas_price_corpus(&self) -> Option<Corpus<U256>>[src]

Get gas price corpus, if recent enough.

pub fn set_gas_price_corpus(&mut self, corpus: Corpus<U256>)[src]

Set the cached gas price corpus.

pub fn mem_used(&self) -> usize[src]

Get the memory used.

Trait Implementations

impl MallocSizeOf for Cache[src]

Auto Trait Implementations

impl RefUnwindSafe for Cache

impl Send for Cache

impl Sync for Cache

impl Unpin for Cache

impl UnwindSafe for Cache

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MallocSizeOfExt for T where
    T: MallocSizeOf
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,