[][src]Trait ckb_store::ChainStore

pub trait ChainStore<'a>: Send + Sync + Sized {
    type Vector: AsRef<[u8]>;
    pub fn cache(&'a self) -> Option<&'a StoreCache>;
pub fn get(&'a self, col: Col, key: &[u8]) -> Option<Self::Vector>;
pub fn get_iter(&self, col: Col, mode: IteratorMode<'_>) -> DBIter<'_>; pub fn cell_provider(&self) -> CellProviderWrapper<'_, Self> { ... }
pub fn get_block(&'a self, h: &Byte32) -> Option<BlockView> { ... }
pub fn get_block_header(&'a self, hash: &Byte32) -> Option<HeaderView> { ... }
pub fn get_block_body(&'a self, hash: &Byte32) -> Vec<TransactionView> { ... }
pub fn get_block_txs_hashes(&'a self, hash: &Byte32) -> Vec<Byte32> { ... }
pub fn get_block_proposal_txs_ids(
        &'a self,
        hash: &Byte32
    ) -> Option<ProposalShortIdVec> { ... }
pub fn get_block_uncles(
        &'a self,
        hash: &Byte32
    ) -> Option<UncleBlockVecView> { ... }
pub fn get_block_ext(&'a self, block_hash: &Byte32) -> Option<BlockExt> { ... }
pub fn get_block_hash(&'a self, number: BlockNumber) -> Option<Byte32> { ... }
pub fn get_block_number(&'a self, hash: &Byte32) -> Option<BlockNumber> { ... }
pub fn is_main_chain(&'a self, hash: &Byte32) -> bool { ... }
pub fn get_tip_header(&'a self) -> Option<HeaderView> { ... }
pub fn get_transaction(
        &'a self,
        hash: &Byte32
    ) -> Option<(TransactionView, Byte32)> { ... }
pub fn get_transaction_with_info(
        &'a self,
        hash: &Byte32
    ) -> Option<(TransactionView, TransactionInfo)> { ... }
pub fn get_transaction_info(
        &'a self,
        hash: &Byte32
    ) -> Option<TransactionInfo> { ... }
pub fn get_cell(&'a self, out_point: &OutPoint) -> Option<CellMeta> { ... }
pub fn get_cell_data(
        &'a self,
        out_point: &OutPoint
    ) -> Option<(Bytes, Byte32)> { ... }
pub fn get_current_epoch_ext(&'a self) -> Option<EpochExt> { ... }
pub fn get_epoch_ext(&'a self, hash: &Byte32) -> Option<EpochExt> { ... }
pub fn get_epoch_index(&'a self, number: EpochNumber) -> Option<Byte32> { ... }
pub fn get_block_epoch_index(
        &'a self,
        block_hash: &Byte32
    ) -> Option<Byte32> { ... }
pub fn get_block_epoch(&'a self, hash: &Byte32) -> Option<EpochExt> { ... }
pub fn is_uncle(&'a self, hash: &Byte32) -> bool { ... }
pub fn get_uncle_header(&'a self, hash: &Byte32) -> Option<HeaderView> { ... }
pub fn block_exists(&'a self, hash: &Byte32) -> bool { ... }
pub fn get_cellbase(&'a self, hash: &Byte32) -> Option<TransactionView> { ... }
pub fn next_epoch_ext(
        &'a self,
        consensus: &Consensus,
        last_epoch: &EpochExt,
        header: &HeaderView
    ) -> Option<EpochExt> { ... }
pub fn get_packed_block(&'a self, hash: &Byte32) -> Option<Block> { ... }
pub fn get_packed_block_header(&'a self, hash: &Byte32) -> Option<Header> { ... } }

TODO(doc): @quake

Associated Types

type Vector: AsRef<[u8]>[src]

TODO(doc): @quake

Loading content...

Required methods

pub fn cache(&'a self) -> Option<&'a StoreCache>[src]

TODO(doc): @quake

pub fn get(&'a self, col: Col, key: &[u8]) -> Option<Self::Vector>[src]

TODO(doc): @quake

pub fn get_iter(&self, col: Col, mode: IteratorMode<'_>) -> DBIter<'_>[src]

TODO(doc): @quake

Loading content...

Provided methods

pub fn cell_provider(&self) -> CellProviderWrapper<'_, Self>[src]

TODO(doc): @quake

pub fn get_block(&'a self, h: &Byte32) -> Option<BlockView>[src]

Get block by block header hash

pub fn get_block_header(&'a self, hash: &Byte32) -> Option<HeaderView>[src]

Get header by block header hash

pub fn get_block_body(&'a self, hash: &Byte32) -> Vec<TransactionView>[src]

Get block body by block header hash

pub fn get_block_txs_hashes(&'a self, hash: &Byte32) -> Vec<Byte32>[src]

Get all transaction-hashes in block body by block header hash

pub fn get_block_proposal_txs_ids(
    &'a self,
    hash: &Byte32
) -> Option<ProposalShortIdVec>
[src]

Get proposal short id by block header hash

pub fn get_block_uncles(&'a self, hash: &Byte32) -> Option<UncleBlockVecView>[src]

Get block uncles by block header hash

pub fn get_block_ext(&'a self, block_hash: &Byte32) -> Option<BlockExt>[src]

Get block ext by block header hash

pub fn get_block_hash(&'a self, number: BlockNumber) -> Option<Byte32>[src]

Get block header hash by block number

pub fn get_block_number(&'a self, hash: &Byte32) -> Option<BlockNumber>[src]

Get block number by block header hash

pub fn is_main_chain(&'a self, hash: &Byte32) -> bool[src]

TODO(doc): @quake

pub fn get_tip_header(&'a self) -> Option<HeaderView>[src]

TODO(doc): @quake

pub fn get_transaction(
    &'a self,
    hash: &Byte32
) -> Option<(TransactionView, Byte32)>
[src]

Get commit transaction and block hash by its hash

pub fn get_transaction_with_info(
    &'a self,
    hash: &Byte32
) -> Option<(TransactionView, TransactionInfo)>
[src]

TODO(doc): @quake

pub fn get_transaction_info(&'a self, hash: &Byte32) -> Option<TransactionInfo>[src]

TODO(doc): @quake

pub fn get_cell(&'a self, out_point: &OutPoint) -> Option<CellMeta>[src]

TODO(doc): @quake

pub fn get_cell_data(&'a self, out_point: &OutPoint) -> Option<(Bytes, Byte32)>[src]

TODO(doc): @quake

pub fn get_current_epoch_ext(&'a self) -> Option<EpochExt>[src]

Gets current epoch ext

pub fn get_epoch_ext(&'a self, hash: &Byte32) -> Option<EpochExt>[src]

Gets epoch ext by epoch index

pub fn get_epoch_index(&'a self, number: EpochNumber) -> Option<Byte32>[src]

Gets epoch index by epoch number

pub fn get_block_epoch_index(&'a self, block_hash: &Byte32) -> Option<Byte32>[src]

Gets epoch index by block hash

pub fn get_block_epoch(&'a self, hash: &Byte32) -> Option<EpochExt>[src]

TODO(doc): @quake

pub fn is_uncle(&'a self, hash: &Byte32) -> bool[src]

TODO(doc): @quake

pub fn get_uncle_header(&'a self, hash: &Byte32) -> Option<HeaderView>[src]

Gets header by uncle header hash

pub fn block_exists(&'a self, hash: &Byte32) -> bool[src]

TODO(doc): @quake

pub fn get_cellbase(&'a self, hash: &Byte32) -> Option<TransactionView>[src]

Gets cellbase by block hash

pub fn next_epoch_ext(
    &'a self,
    consensus: &Consensus,
    last_epoch: &EpochExt,
    header: &HeaderView
) -> Option<EpochExt>
[src]

TODO(doc): @quake

pub fn get_packed_block(&'a self, hash: &Byte32) -> Option<Block>[src]

TODO(doc): @quake

pub fn get_packed_block_header(&'a self, hash: &Byte32) -> Option<Header>[src]

TODO(doc): @quake

Loading content...

Implementors

impl<'a> ChainStore<'a> for ChainDB[src]

type Vector = DBPinnableSlice<'a>

impl<'a> ChainStore<'a> for StoreSnapshot[src]

type Vector = DBPinnableSlice<'a>

impl<'a> ChainStore<'a> for StoreTransaction[src]

type Vector = DBVector

Loading content...