pub struct BlockEvent<B> {
pub block: B,
pub checkpoint: CheckPoint,
}Expand description
A newly emitted block from Emitter.
Fields§
§block: BThe block.
checkpoint: CheckPointThe checkpoint of the new block.
A CheckPoint is a node of a linked list of BlockIds. This checkpoint is linked to
all BlockIds originally passed in Emitter::new as well as emitted blocks since
then. These blocks are guaranteed to be of the same chain.
This is important as BDK structures require block-to-apply to be connected with another block in the original chain.
Implementations§
Source§impl<B> BlockEvent<B>
impl<B> BlockEvent<B>
Sourcepub fn block_height(&self) -> u32
pub fn block_height(&self) -> u32
The block height of this new block.
Sourcepub fn block_hash(&self) -> BlockHash
pub fn block_hash(&self) -> BlockHash
The block hash of this new block.
Sourcepub fn connected_to(&self) -> BlockId
pub fn connected_to(&self) -> BlockId
The BlockId of a previous block that this block connects to.
This either returns a BlockId of a previously emitted block or from the chain we started
with (passed in as last_cp in Emitter::new).
This value is derived from BlockEvent::checkpoint.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for BlockEvent<B>where
B: Freeze,
impl<B> RefUnwindSafe for BlockEvent<B>where
B: RefUnwindSafe,
impl<B> Send for BlockEvent<B>where
B: Send,
impl<B> Sync for BlockEvent<B>where
B: Sync,
impl<B> Unpin for BlockEvent<B>where
B: Unpin,
impl<B> UnwindSafe for BlockEvent<B>where
B: 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