[−][src]Trait blockchain::traits::ChainQuery
Chain query interface for a backend.
Required methods
fn genesis(&self) -> <Self::Block as Block>::Identifier
Get the genesis hash of the chain.
fn head(&self) -> <Self::Block as Block>::Identifier
Get the head of the chain.
fn contains(
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<bool, Self::Error>
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<bool, Self::Error>
Check whether a hash is contained in the chain.
fn is_canon(
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<bool, Self::Error>
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<bool, Self::Error>
Check whether a block is canonical.
fn lookup_canon_depth(
&self,
depth: usize
) -> Result<Option<<Self::Block as Block>::Identifier>, Self::Error>
&self,
depth: usize
) -> Result<Option<<Self::Block as Block>::Identifier>, Self::Error>
Look up a canonical block via its depth.
fn auxiliary(
&self,
key: &<Self::Auxiliary as Auxiliary<Self::Block>>::Key
) -> Result<Option<Self::Auxiliary>, Self::Error>
&self,
key: &<Self::Auxiliary as Auxiliary<Self::Block>>::Key
) -> Result<Option<Self::Auxiliary>, Self::Error>
Get the auxiliary value by key.
fn depth_at(
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<usize, Self::Error>
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<usize, Self::Error>
Get the depth of a block.
fn children_at(
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<Vec<<Self::Block as Block>::Identifier>, Self::Error>
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<Vec<<Self::Block as Block>::Identifier>, Self::Error>
Get children of a block.
fn state_at(
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<Self::State, Self::Error>
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<Self::State, Self::Error>
Get the state object of a block.
fn block_at(
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<Self::Block, Self::Error>
&self,
hash: &<Self::Block as Block>::Identifier
) -> Result<Self::Block, Self::Error>
Get the object of a block.
Implementors
impl<B: Block, A: Auxiliary<B>, S: Clone> ChainQuery for MemoryBackend<B, A, S>
[src]
fn head(&self) -> B::Identifier
[src]
fn genesis(&self) -> B::Identifier
[src]
fn contains(&self, id: &B::Identifier) -> Result<bool, Error>
[src]
fn is_canon(&self, id: &B::Identifier) -> Result<bool, Error>
[src]
fn lookup_canon_depth(
&self,
depth: usize
) -> Result<Option<B::Identifier>, Error>
[src]
&self,
depth: usize
) -> Result<Option<B::Identifier>, Error>