pub struct BlockId {
pub height: u32,
pub hash: BlockHash,
}
Expand description
A reference to a block in the canonical chain.
BlockId
implements Anchor
. When a transaction is anchored to BlockId
, the confirmation
block and anchor block are the same block.
Fields§
§height: u32
The height of the block.
hash: BlockHash
The hash of the block.
Trait Implementations§
source§impl Anchor for BlockId
impl Anchor for BlockId
source§fn anchor_block(&self) -> Self
fn anchor_block(&self) -> Self
Returns the
BlockId
that the associated blockchain data is “anchored” in.source§fn confirmation_height_upper_bound(&self) -> u32
fn confirmation_height_upper_bound(&self) -> u32
Get the upper bound of the chain data’s confirmation height. Read more
source§impl AnchorFromBlockPosition for BlockId
impl AnchorFromBlockPosition for BlockId
source§fn from_block_position(_block: &Block, block_id: BlockId, _tx_pos: usize) -> Self
fn from_block_position(_block: &Block, block_id: BlockId, _tx_pos: usize) -> Self
Construct the anchor from a given
block
, block height and tx_pos
within the block.source§impl<'de> Deserialize<'de> for BlockId
impl<'de> Deserialize<'de> for BlockId
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for BlockId
impl Ord for BlockId
source§impl PartialOrd<BlockId> for BlockId
impl PartialOrd<BlockId> for BlockId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more