ckb_store

Struct StoreTransaction

Source
pub struct StoreTransaction { /* private fields */ }
Expand description

A Transaction DB

Implementations§

Source§

impl StoreTransaction

Source

pub fn insert_raw( &self, col: Col, key: &[u8], value: &[u8], ) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn delete(&self, col: Col, key: &[u8]) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn commit(&self) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn get_snapshot(&self) -> StoreTransactionSnapshot<'_>

TODO(doc): @quake

Source

pub fn get_update_for_tip_hash( &self, snapshot: &StoreTransactionSnapshot<'_>, ) -> Option<Byte32>

TODO(doc): @quake

Source

pub fn insert_tip_header(&self, h: &HeaderView) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn insert_block(&self, block: &BlockView) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn delete_block(&self, block: &BlockView) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn insert_block_ext( &self, block_hash: &Byte32, ext: &BlockExt, ) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn attach_block(&self, block: &BlockView) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn detach_block(&self, block: &BlockView) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn insert_block_epoch_index( &self, block_hash: &Byte32, epoch_hash: &Byte32, ) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn insert_epoch_ext( &self, hash: &Byte32, epoch: &EpochExt, ) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn insert_current_epoch_ext(&self, epoch: &EpochExt) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn insert_cells( &self, cells: impl Iterator<Item = (OutPoint, CellEntry, Option<CellDataEntry>)>, ) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn delete_cells( &self, out_points: impl Iterator<Item = OutPoint>, ) -> Result<(), Error>

TODO(doc): @quake

Source

pub fn insert_header_digest( &self, position_u64: u64, header_digest: &HeaderDigest, ) -> Result<(), Error>

Inserts a header digest.

Source

pub fn delete_header_digest(&self, position_u64: u64) -> Result<(), Error>

Deletes a header digest.

Source

pub fn insert_block_filter( &self, block_hash: &Byte32, filter_data: &Bytes, parent_block_filter_hash: &Byte32, ) -> Result<(), Error>

insert block filter data

Trait Implementations§

Source§

impl CellChecker for StoreTransaction

Source§

fn is_live(&self, out_point: &OutPoint) -> Option<bool>

Returns true if the cell is live corresponding to specified out_point.
Source§

impl CellProvider for StoreTransaction

Source§

fn cell(&self, out_point: &OutPoint, eager_load: bool) -> CellStatus

TODO(doc): @quake
Source§

impl ChainStore for StoreTransaction

Source§

fn cache(&self) -> Option<&StoreCache>

Return cache reference
Source§

fn freezer(&self) -> Option<&Freezer>

Return freezer reference
Source§

fn get(&self, col: Col, key: &[u8]) -> Option<DBPinnableSlice<'_>>

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

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

Return an iterator over the database key-value pairs in the given column family.
Source§

fn borrow_as_data_loader(&self) -> BorrowedDataLoaderWrapper<'_, Self>

Return the borrowed data loader wrapper
Source§

fn get_block(&self, h: &Byte32) -> Option<BlockView>

Get block by block header hash
Source§

fn get_block_header(&self, hash: &Byte32) -> Option<HeaderView>

Get header by block header hash
Source§

fn get_block_body(&self, hash: &Byte32) -> Vec<TransactionView>

Get block body by block header hash
Source§

fn get_unfrozen_block(&self, hash: &Byte32) -> Option<BlockView>

Get unfrozen block from ky-store with given hash
Source§

fn get_block_txs_hashes(&self, hash: &Byte32) -> Vec<Byte32>

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

fn get_block_proposal_txs_ids( &self, hash: &Byte32, ) -> Option<ProposalShortIdVec>

Get proposal short id by block header hash
Source§

fn get_block_uncles(&self, hash: &Byte32) -> Option<UncleBlockVecView>

Get block uncles by block header hash
Source§

fn get_block_extension(&self, hash: &Byte32) -> Option<Bytes>

Get block extension by block header hash
Source§

fn get_block_ext(&self, block_hash: &Byte32) -> Option<BlockExt>

Get block ext by block header hash Read more
Source§

fn get_block_hash(&self, number: BlockNumber) -> Option<Byte32>

Get block header hash by block number
Source§

fn get_block_number(&self, hash: &Byte32) -> Option<BlockNumber>

Get block number by block header hash
Source§

fn is_main_chain(&self, hash: &Byte32) -> bool

TODO(doc): @quake
Source§

fn get_tip_header(&self) -> Option<HeaderView>

TODO(doc): @quake
Source§

fn transaction_exists(&self, hash: &Byte32) -> bool

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

fn get_transaction(&self, hash: &Byte32) -> Option<(TransactionView, Byte32)>

Get commit transaction and block hash by its hash
Source§

fn get_transaction_info(&self, hash: &Byte32) -> Option<TransactionInfo>

TODO(doc): @quake
Source§

fn get_transaction_with_info( &self, hash: &Byte32, ) -> Option<(TransactionView, TransactionInfo)>

Gets transaction and associated info with correspond hash
Source§

fn have_cell(&self, out_point: &OutPoint) -> bool

Return whether cell is live
Source§

fn get_cell(&self, out_point: &OutPoint) -> Option<CellMeta>

Gets cell meta data with out_point
Source§

fn get_cell_data(&self, out_point: &OutPoint) -> Option<(Bytes, Byte32)>

TODO(doc): @quake
Source§

fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>

TODO(doc): @quake
Source§

fn get_current_epoch_ext(&self) -> Option<EpochExt>

Gets current epoch ext
Source§

fn get_epoch_ext(&self, hash: &Byte32) -> Option<EpochExt>

Gets epoch ext by epoch index
Source§

fn get_epoch_index(&self, number: EpochNumber) -> Option<Byte32>

Gets epoch index by epoch number
Source§

fn get_block_epoch_index(&self, block_hash: &Byte32) -> Option<Byte32>

Gets epoch index by block hash
Source§

fn get_block_epoch(&self, hash: &Byte32) -> Option<EpochExt>

TODO(doc): @quake
Source§

fn is_uncle(&self, hash: &Byte32) -> bool

TODO(doc): @quake
Source§

fn get_uncle_header(&self, hash: &Byte32) -> Option<HeaderView>

Gets header by uncle header hash
Source§

fn block_exists(&self, hash: &Byte32) -> bool

TODO(doc): @quake
Source§

fn get_cellbase(&self, hash: &Byte32) -> Option<TransactionView>

Gets cellbase by block hash
Source§

fn get_latest_built_filter_data_block_hash(&self) -> Option<Byte32>

Gets latest built filter data block hash
Source§

fn get_block_filter(&self, hash: &Byte32) -> Option<Bytes>

Gets block filter data by block hash
Source§

fn get_block_filter_hash(&self, hash: &Byte32) -> Option<Byte32>

Gets block filter hash by block hash
Source§

fn get_packed_block(&self, hash: &Byte32) -> Option<Block>

Gets block bytes by block hash
Source§

fn get_packed_block_header(&self, hash: &Byte32) -> Option<Header>

Gets block header bytes by block hash
Source§

fn get_header_digest(&self, position_u64: u64) -> Option<HeaderDigest>

Gets a header digest.
Source§

fn get_ancestor(&self, base: &Byte32, number: BlockNumber) -> Option<HeaderView>

Gets ancestor block header by a base block hash and number
Source§

impl MMRStore<HeaderDigest> for &StoreTransaction

Source§

fn get_elem(&self, pos: u64) -> MMRResult<Option<HeaderDigest>>

Source§

fn append(&mut self, pos: u64, elems: Vec<HeaderDigest>) -> MMRResult<()>

Source§

impl VersionbitsIndexer for StoreTransaction

Source§

fn block_epoch_index(&self, block_hash: &Byte32) -> Option<Byte32>

Gets epoch index by block hash
Source§

fn epoch_ext(&self, index: &Byte32) -> Option<EpochExt>

Gets epoch ext by index
Source§

fn block_header(&self, block_hash: &Byte32) -> Option<HeaderView>

Gets block header by block hash
Source§

fn cellbase(&self, block_hash: &Byte32) -> Option<TransactionView>

Gets cellbase by block hash
Source§

fn ancestor_epoch(&self, index: &Byte32, target: u64) -> Option<EpochExt>

Gets ancestor of specified epoch.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

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

Cast to trait Any
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T