pub struct BlockExtra { /* private fields */ }
Expand description
The bitcoin block and additional metadata returned by the crate::iter() method
Implementations§
Source§impl BlockExtra
impl BlockExtra
pub fn version(&self) -> u8
Sourcepub fn block(&self) -> &Block
pub fn block(&self) -> &Block
Returns the block from the bytes
This is an expensive operation, re-use the results instead of calling it multiple times
pub fn block_bytes(&self) -> &[u8] ⓘ
pub fn block_hash(&self) -> BlockHash
pub fn size(&self) -> u32
pub fn next(&self) -> &Vec<BlockHash>
pub fn height(&self) -> u32
pub fn outpoint_values(&self) -> &HashMap<OutPoint, TxOut>
pub fn block_total_inputs(&self) -> usize
pub fn block_total_outputs(&self) -> usize
pub fn txids(&self) -> &Vec<Txid>
Sourcepub fn average_fee(&self) -> Option<f64>
pub fn average_fee(&self) -> Option<f64>
Returns the average transaction fee in the block
Sourcepub fn tx_fee(&self, tx: &Transaction) -> Option<u64>
pub fn tx_fee(&self, tx: &Transaction) -> Option<u64>
Returns the fee of a transaction contained in the block
Sourcepub fn base_reward(&self) -> u64
pub fn base_reward(&self) -> u64
Return the base block reward in satoshi
Sourcepub fn iter_tx(&self) -> impl Iterator<Item = (&Txid, &Transaction)>
pub fn iter_tx(&self) -> impl Iterator<Item = (&Txid, &Transaction)>
Iterate transactions of blocks together with their txids
requires serializing the block bytes, consider using a visitor on the bytes for performance
Trait Implementations§
Source§impl Debug for BlockExtra
impl Debug for BlockExtra
Source§impl Decodable for BlockExtra
impl Decodable for BlockExtra
Source§impl Encodable for BlockExtra
impl Encodable for BlockExtra
Source§impl PartialEq for BlockExtra
impl PartialEq for BlockExtra
Source§impl TryFrom<FsBlock> for BlockExtra
impl TryFrom<FsBlock> for BlockExtra
impl Eq for BlockExtra
impl StructuralPartialEq for BlockExtra
Auto Trait Implementations§
impl !Freeze for BlockExtra
impl RefUnwindSafe for BlockExtra
impl Send for BlockExtra
impl Sync for BlockExtra
impl Unpin for BlockExtra
impl UnwindSafe for BlockExtra
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