pub struct BlockIndex { /* private fields */ }Expand description
A block index that is tied to a specific ChainstateManager.
Internally the ChainstateManager keeps an in-memory of the current block
tree once it is loaded. The BlockIndex points to an entry in this tree.
It is only valid as long as the ChainstateManager it was retrieved from
remains in scope.
Implementations§
Source§impl BlockIndex
impl BlockIndex
Sourcepub fn prev(self) -> Result<BlockIndex, KernelError>
pub fn prev(self) -> Result<BlockIndex, KernelError>
Move to the previous entry in the block tree. E.g. from height n to height n-1.
Sourcepub fn block_hash(&self) -> BlockHash
pub fn block_hash(&self) -> BlockHash
Get the current block hash associated with this BlockIndex.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlockIndex
impl !RefUnwindSafe for BlockIndex
impl Unpin for BlockIndex
impl !UnwindSafe for BlockIndex
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