pub struct BlockTreeSnapshot<S: KVGet>(pub(super) S);
Expand description
A read-only view into the block tree that is guaranteed to stay unchanged.
Tuple Fields§
§0: S
Implementations§
source§impl<S: KVGet> BlockTreeSnapshot<S>
impl<S: KVGet> BlockTreeSnapshot<S>
pub(crate) fn new(kv_snapshot: S) -> Self
sourcepub(crate) fn blocks_from_height_to_newest(
&self,
height: BlockHeight,
limit: u32,
) -> Result<Vec<Block>, BlockTreeError>
pub(crate) fn blocks_from_height_to_newest( &self, height: BlockHeight, limit: u32, ) -> Result<Vec<Block>, BlockTreeError>
Get a chain of blocks starting from the specified tail block and going towards the newest block, up until the limit.
If tail is None, then the chain starts from genesis instead.
sourcefn blocks_from_newest_to_committed(&self) -> Result<Vec<Block>, BlockTreeError>
fn blocks_from_newest_to_committed(&self) -> Result<Vec<Block>, BlockTreeError>
Get a chain of blocks from the newest block up to (but not including) the highest committed block, or genesis.
The returned chain goes from blocks of higher height (newest block) to blocks of lower height.
pub(crate) fn highest_committed_block_height( &self, ) -> Result<Option<BlockHeight>, BlockTreeError>
pub fn block(&self, block: &CryptoHash) -> Result<Option<Block>, BlockTreeError>
pub fn block_height( &self, block: &CryptoHash, ) -> Result<Option<BlockHeight>, BlockTreeError>
pub fn block_data_hash( &self, block: &CryptoHash, ) -> Result<Option<CryptoHash>, BlockTreeError>
pub fn block_justify( &self, block: &CryptoHash, ) -> Result<PhaseCertificate, BlockTreeError>
pub fn block_data_len( &self, block: &CryptoHash, ) -> Result<Option<DataLen>, BlockTreeError>
pub fn block_data( &self, block: &CryptoHash, ) -> Result<Option<Data>, BlockTreeError>
pub fn block_datum(&self, block: &CryptoHash, datum_index: u32) -> Option<Datum>
pub fn block_at_height( &self, height: BlockHeight, ) -> Result<Option<CryptoHash>, BlockTreeError>
pub fn children( &self, block: &CryptoHash, ) -> Result<ChildrenList, BlockTreeError>
pub fn committed_app_state(&self, key: &[u8]) -> Option<Vec<u8>>
pub fn pending_app_state_updates( &self, block: &CryptoHash, ) -> Result<Option<AppStateUpdates>, BlockTreeError>
pub fn committed_validator_set(&self) -> Result<ValidatorSet, BlockTreeError>
pub fn validator_set_updates_status( &self, block: &CryptoHash, ) -> Result<ValidatorSetUpdatesStatus, BlockTreeError>
pub fn locked_pc(&self) -> Result<PhaseCertificate, BlockTreeError>
pub fn highest_view_entered(&self) -> Result<ViewNumber, BlockTreeError>
pub fn highest_pc(&self) -> Result<PhaseCertificate, BlockTreeError>
pub fn highest_committed_block( &self, ) -> Result<Option<CryptoHash>, BlockTreeError>
pub fn newest_block(&self) -> Result<Option<CryptoHash>, BlockTreeError>
pub fn highest_tc(&self) -> Result<Option<TimeoutCertificate>, BlockTreeError>
pub fn previous_validator_set(&self) -> Result<ValidatorSet, BlockTreeError>
pub fn validator_set_update_block_height( &self, ) -> Result<Option<BlockHeight>, BlockTreeError>
pub fn validator_set_update_complete(&self) -> Result<bool, BlockTreeError>
pub fn validator_set_state(&self) -> Result<ValidatorSetState, BlockTreeError>
pub fn highest_view_voted(&self) -> Result<Option<ViewNumber>, BlockTreeError>
Auto Trait Implementations§
impl<S> Freeze for BlockTreeSnapshot<S>where
S: Freeze,
impl<S> RefUnwindSafe for BlockTreeSnapshot<S>where
S: RefUnwindSafe,
impl<S> Send for BlockTreeSnapshot<S>where
S: Send,
impl<S> Sync for BlockTreeSnapshot<S>where
S: Sync,
impl<S> Unpin for BlockTreeSnapshot<S>where
S: Unpin,
impl<S> UnwindSafe for BlockTreeSnapshot<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more