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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for Twhere T: Any,

§

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

Cast to trait Any
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more