hotstuff_rs::block_tree::accessors::public

Struct BlockTreeSnapshot

source
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>

source

pub(crate) fn new(kv_snapshot: S) -> Self

source

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.

source

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.

source

pub(crate) fn highest_committed_block_height( &self, ) -> Result<Option<BlockHeight>, BlockTreeError>

source

pub fn block(&self, block: &CryptoHash) -> Result<Option<Block>, BlockTreeError>

source

pub fn block_height( &self, block: &CryptoHash, ) -> Result<Option<BlockHeight>, BlockTreeError>

source

pub fn block_data_hash( &self, block: &CryptoHash, ) -> Result<Option<CryptoHash>, BlockTreeError>

source

pub fn block_justify( &self, block: &CryptoHash, ) -> Result<PhaseCertificate, BlockTreeError>

source

pub fn block_data_len( &self, block: &CryptoHash, ) -> Result<Option<DataLen>, BlockTreeError>

source

pub fn block_data( &self, block: &CryptoHash, ) -> Result<Option<Data>, BlockTreeError>

source

pub fn block_datum(&self, block: &CryptoHash, datum_index: u32) -> Option<Datum>

source

pub fn block_at_height( &self, height: BlockHeight, ) -> Result<Option<CryptoHash>, BlockTreeError>

source

pub fn children( &self, block: &CryptoHash, ) -> Result<ChildrenList, BlockTreeError>

source

pub fn committed_app_state(&self, key: &[u8]) -> Option<Vec<u8>>

source

pub fn pending_app_state_updates( &self, block: &CryptoHash, ) -> Result<Option<AppStateUpdates>, BlockTreeError>

source

pub fn committed_validator_set(&self) -> Result<ValidatorSet, BlockTreeError>

source

pub fn validator_set_updates_status( &self, block: &CryptoHash, ) -> Result<ValidatorSetUpdatesStatus, BlockTreeError>

source

pub fn locked_pc(&self) -> Result<PhaseCertificate, BlockTreeError>

source

pub fn highest_view_entered(&self) -> Result<ViewNumber, BlockTreeError>

source

pub fn highest_pc(&self) -> Result<PhaseCertificate, BlockTreeError>

source

pub fn highest_committed_block( &self, ) -> Result<Option<CryptoHash>, BlockTreeError>

source

pub fn newest_block(&self) -> Result<Option<CryptoHash>, BlockTreeError>

source

pub fn highest_tc(&self) -> Result<Option<TimeoutCertificate>, BlockTreeError>

source

pub fn previous_validator_set(&self) -> Result<ValidatorSet, BlockTreeError>

source

pub fn validator_set_update_block_height( &self, ) -> Result<Option<BlockHeight>, BlockTreeError>

source

pub fn validator_set_update_complete(&self) -> Result<bool, BlockTreeError>

source

pub fn validator_set_state(&self) -> Result<ValidatorSetState, BlockTreeError>

source

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
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> 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.
§

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

§

fn vzip(self) -> V