Struct ckb_store::ChainDB[][src]

pub struct ChainDB { /* fields omitted */ }
Expand description

TODO(doc): @quake

Implementations

impl ChainDB[src]

pub fn new(db: RocksDB, config: StoreConfig) -> Self[src]

TODO(doc): @quake

pub fn new_with_freezer(
    db: RocksDB,
    freezer: Freezer,
    config: StoreConfig
) -> Self
[src]

Open new ChainDB with freezer instance

pub fn db(&self) -> &RocksDB[src]

TODO(doc): @quake

pub fn into_inner(self) -> RocksDB[src]

TODO(doc): @quake

pub fn put_chain_spec_hash(&self, hash: &Byte32) -> Result<(), Error>[src]

Store the chain spec hash

pub fn get_chain_spec_hash(&self) -> Option<Byte32>[src]

Return the chain spec hash

pub fn begin_transaction(&self) -> StoreTransaction[src]

TODO(doc): @quake

pub fn get_snapshot(&self) -> StoreSnapshot[src]

TODO(doc): @quake

pub fn new_write_batch(&self) -> StoreWriteBatch[src]

TODO(doc): @quake

pub fn write(&self, write_batch: &StoreWriteBatch) -> Result<(), Error>[src]

TODO(doc): @quake

pub fn write_sync(&self, write_batch: &StoreWriteBatch) -> Result<(), Error>[src]

write options set_sync = true

see RocksDB::write_sync.

pub fn compact_range(
    &self,
    col: Col,
    start: Option<&[u8]>,
    end: Option<&[u8]>
) -> Result<(), Error>
[src]

Force the data to go through the compaction in order to consolidate it

see RocksDB::compact_range.

pub fn init(&self, consensus: &Consensus) -> Result<(), Error>[src]

TODO(doc): @quake

Trait Implementations

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

type Vector = DBPinnableSlice<'a>

TODO(doc): @quake

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

TODO(doc): @quake

fn freezer(&'a self) -> Option<&'a Freezer>[src]

Return freezer reference

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

Return the bytes associated with a key value and the given column family.

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

TODO(doc): @quake

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

TODO(doc): @quake

fn as_data_provider(&'a self) -> DataLoaderWrapper<'a, Self>[src]

Return the provider trait default implementation

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

Get block by block header hash

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

Get header by block header hash

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

Get block body by block header hash

fn get_unfrozen_block(&'a self, hash: &Byte32) -> Option<BlockView>[src]

Get unfrozen block from ky-store with given hash

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

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

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

Get proposal short id by block header hash

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

Get block uncles by block header hash

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

Get block ext by block header hash

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

Get block header hash by block number

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

Get block number by block header hash

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

TODO(doc): @quake

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

TODO(doc): @quake

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

Returns true if the transaction confirmed in main chain. Read more

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

Get commit transaction and block hash by its hash

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

TODO(doc): @quake

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

Gets transaction and associated info with correspond hash

fn have_cell(&'a self, out_point: &OutPoint) -> bool[src]

Return whether cell is live

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

Gets cell meta data with out_point

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

TODO(doc): @quake

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

Gets current epoch ext

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

Gets epoch ext by epoch index

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

Gets epoch index by epoch number

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

Gets epoch index by block hash

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

TODO(doc): @quake

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

TODO(doc): @quake

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

Gets header by uncle header hash

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

TODO(doc): @quake

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

Gets cellbase by block hash

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

TODO(doc): @quake

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

TODO(doc): @quake

impl Clone for ChainDB[src]

fn clone(&self) -> ChainDB[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !RefUnwindSafe for ChainDB

impl Send for ChainDB

impl Sync for ChainDB

impl Unpin for ChainDB

impl !UnwindSafe for ChainDB

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> AsAny for T where
    T: Any

pub fn as_any(&self) -> &(dyn Any + 'static)

TODO(doc): @quake

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V