Struct sc_client_api::in_mem::Blockchain[][src]

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

In-memory blockchain. Supports concurrent reads.

Implementations

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

pub fn id(&self, id: BlockId<Block>) -> Option<Block::Hash>[src]

Get header hash of given block.

pub fn new() -> Blockchain<Block>[src]

Create new in-memory blockchain storage.

pub fn insert(
    &self,
    hash: Block::Hash,
    header: <Block as BlockT>::Header,
    justification: Option<Justification>,
    body: Option<Vec<<Block as BlockT>::Extrinsic>>,
    new_state: NewBlockState
) -> Result<()>
[src]

Insert a block header and associated data.

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

Get total number of blocks.

pub fn equals_to(&self, other: &Self) -> bool[src]

Compare this blockchain with another in-mem blockchain

pub fn canon_equals_to(&self, other: &Self) -> bool[src]

Compare canonical chain to other canonical chain.

pub fn insert_cht_root(&self, block: NumberFor<Block>, cht_root: Block::Hash)[src]

Insert header CHT root.

pub fn set_head(&self, id: BlockId<Block>) -> Result<()>[src]

Set an existing block as head.

Trait Implementations

impl<Block: BlockT> AuxStore for Blockchain<Block>[src]

impl<Block: BlockT> Backend<Block> for Blockchain<Block>[src]

impl<Block: BlockT + Clone> Clone for Blockchain<Block>[src]

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

impl<Block: BlockT> HeaderBackend<Block> for Blockchain<Block>[src]

impl<Block: BlockT> HeaderMetadata<Block> for Blockchain<Block>[src]

type Error = Error

Error used in case the header metadata is not found.

impl<Block: BlockT> ProvideCache<Block> for Blockchain<Block>[src]

impl<Block: BlockT> ProvideChtRoots<Block> for Blockchain<Block>[src]

impl<Block: BlockT> Storage<Block> for Blockchain<Block> where
    Block::Hash: From<[u8; 32]>, 
[src]

Auto Trait Implementations

impl<Block> !RefUnwindSafe for Blockchain<Block>

impl<Block> Send for Blockchain<Block>

impl<Block> Sync for Blockchain<Block>

impl<Block> Unpin for Blockchain<Block>

impl<Block> !UnwindSafe for Blockchain<Block>

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> DynClone for T where
    T: Clone
[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> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

impl<T> SaturatedConversion for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>, 
[src]