Struct stack_test_epic_chain::store::ChainStore
source · [−]pub struct ChainStore { /* private fields */ }
Expand description
All chain-related database operations
Implementations
sourceimpl ChainStore
impl ChainStore
sourcepub fn with_version(&self, version: ProtocolVersion) -> ChainStore
pub fn with_version(&self, version: ProtocolVersion) -> ChainStore
Create a new instance of the chain store based on this instance but with the provided protocol version. This is used when migrating data in the db to a different protocol version, reading using one version and writing back to the db with a different version.
sourceimpl ChainStore
impl ChainStore
sourcepub fn header_head(&self) -> Result<Tip, Error>
pub fn header_head(&self) -> Result<Tip, Error>
The current header head (may differ from chain head).
sourcepub fn get_sync_head(&self) -> Result<Tip, Error>
pub fn get_sync_head(&self) -> Result<Tip, Error>
The “sync” head.
sourcepub fn tail(&self) -> Result<Tip, Error>
pub fn tail(&self) -> Result<Tip, Error>
The current chain “tail” (earliest block in the store).
sourcepub fn head_header(&self) -> Result<BlockHeader, Error>
pub fn head_header(&self) -> Result<BlockHeader, Error>
Header of the block at the head of the block chain (not the same thing as header_head).
sourcepub fn get_block_sums(&self, h: &Hash) -> Result<BlockSums, Error>
pub fn get_block_sums(&self, h: &Hash) -> Result<BlockSums, Error>
Get block_sums for the block hash.
sourcepub fn get_previous_header(
&self,
header: &BlockHeader
) -> Result<BlockHeader, Error>
pub fn get_previous_header(
&self,
header: &BlockHeader
) -> Result<BlockHeader, Error>
Get previous header.
sourcepub fn get_block_header(&self, h: &Hash) -> Result<BlockHeader, Error>
pub fn get_block_header(&self, h: &Hash) -> Result<BlockHeader, Error>
Get block header.
sourcepub fn get_output_pos(&self, commit: &Commitment) -> Result<u64, Error>
pub fn get_output_pos(&self, commit: &Commitment) -> Result<u64, Error>
Get PMMR pos for the given output commitment.
Auto Trait Implementations
impl !RefUnwindSafe for ChainStore
impl Send for ChainStore
impl Sync for ChainStore
impl Unpin for ChainStore
impl !UnwindSafe for ChainStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> SafeBorrow<T> for T where
T: ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more