pub enum ReceiptBlock {
PreConfirmed {
block_number: u64,
},
Block {
block_hash: Felt,
block_number: u64,
},
}Expand description
Block identifier used in
TransactionReceiptWithBlockInfo.
Instead of directly exposing the block_hash and block_number fields as Option<Felt>,
this struct captures the fact that these fields are always Some or
None together, allowing idiomatic access without unnecessary unwraps.
Variants§
PreConfirmed
The receipt is attached to a pre-confirmed block.
Block
The receipt is attached to a confirmed block.
Implementations§
Source§impl ReceiptBlock
impl ReceiptBlock
Sourcepub const fn is_pre_confirmed(&self) -> bool
pub const fn is_pre_confirmed(&self) -> bool
Returns true if and only if it’s the PreConfirmed variant.
Sourcepub const fn block_hash(&self) -> Option<Felt>
pub const fn block_hash(&self) -> Option<Felt>
Returns None if block is not Block.
A more idiomatic way of accessing the block hash is to match the Block enum variant.
Sourcepub const fn block_number(&self) -> u64
pub const fn block_number(&self) -> u64
Returns the block number.
Trait Implementations§
Source§impl Clone for ReceiptBlock
impl Clone for ReceiptBlock
Source§fn clone(&self) -> ReceiptBlock
fn clone(&self) -> ReceiptBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReceiptBlock
impl Debug for ReceiptBlock
Source§impl<'de> Deserialize<'de> for ReceiptBlock
impl<'de> Deserialize<'de> for ReceiptBlock
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 PartialEq for ReceiptBlock
impl PartialEq for ReceiptBlock
Source§impl Serialize for ReceiptBlock
impl Serialize for ReceiptBlock
impl Copy for ReceiptBlock
impl Eq for ReceiptBlock
impl StructuralPartialEq for ReceiptBlock
Auto Trait Implementations§
impl Freeze for ReceiptBlock
impl RefUnwindSafe for ReceiptBlock
impl Send for ReceiptBlock
impl Sync for ReceiptBlock
impl Unpin for ReceiptBlock
impl UnwindSafe for ReceiptBlock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.