[][src]Struct sp_blockchain::HeaderMetadataCache

pub struct HeaderMetadataCache<Block: BlockT> { /* fields omitted */ }

Caches header metadata in an in-memory LRU cache.

Implementations

impl<Block: BlockT> HeaderMetadataCache<Block>[src]

pub fn new(capacity: usize) -> Self[src]

Creates a new LRU header metadata cache with capacity.

impl<Block: BlockT> HeaderMetadataCache<Block>[src]

pub fn header_metadata(
    &self,
    hash: Block::Hash
) -> Option<CachedHeaderMetadata<Block>>
[src]

pub fn insert_header_metadata(
    &self,
    hash: Block::Hash,
    metadata: CachedHeaderMetadata<Block>
)
[src]

pub fn remove_header_metadata(&self, hash: Block::Hash)[src]

Trait Implementations

impl<Block: BlockT> Default for HeaderMetadataCache<Block>[src]

Auto Trait Implementations

impl<Block> !RefUnwindSafe for HeaderMetadataCache<Block>[src]

impl<Block> Send for HeaderMetadataCache<Block> where
    <Block as Block>::Hash: Send,
    <<Block as Block>::Header as Header>::Number: Send
[src]

impl<Block> Sync for HeaderMetadataCache<Block> where
    <Block as Block>::Hash: Send + Sync,
    <<Block as Block>::Header as Header>::Number: Send + Sync
[src]

impl<Block> Unpin for HeaderMetadataCache<Block>[src]

impl<Block> UnwindSafe for HeaderMetadataCache<Block> where
    <Block as Block>::Hash: RefUnwindSafe + UnwindSafe,
    <<Block as Block>::Header as Header>::Number: RefUnwindSafe + UnwindSafe
[src]

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> CheckedConversion for T[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T[src]

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<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 
[src]

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

impl<T> WithSubscriber for T[src]