pub struct BlockReader<'a> { /* private fields */ }Expand description
Reader for block data from Arrow batches.
Provides efficient access to block fields without copying data from the underlying Arrow columnar format. Each reader is bound to a specific row in the batch.
Implementations§
Source§impl<'a> BlockReader<'a>
impl<'a> BlockReader<'a>
Sourcepub fn new(batch: &'a RecordBatch, row_idx: usize) -> Result<Self>
pub fn new(batch: &'a RecordBatch, row_idx: usize) -> Result<Self>
Safely create a new reader for the given batch at row index and check that row_idx is within the bounds of the batch.
Sourcepub fn iter(batch: &'a RecordBatch) -> BlockIterator<'a>
pub fn iter(batch: &'a RecordBatch) -> BlockIterator<'a>
Create an iterator over all rows in the batch.
Sourcepub fn parent_hash(&self) -> Result<Hash, ReadError>
pub fn parent_hash(&self) -> Result<Hash, ReadError>
The parent block hash.
Sourcepub fn sha3_uncles(&self) -> Result<Hash, ReadError>
pub fn sha3_uncles(&self) -> Result<Hash, ReadError>
The SHA3 hash of the uncles.
Sourcepub fn logs_bloom(&self) -> Result<Data, ReadError>
pub fn logs_bloom(&self) -> Result<Data, ReadError>
The Bloom filter for the logs of the block.
Sourcepub fn transactions_root(&self) -> Result<Hash, ReadError>
pub fn transactions_root(&self) -> Result<Hash, ReadError>
The root of the transaction trie of the block.
Sourcepub fn state_root(&self) -> Result<Hash, ReadError>
pub fn state_root(&self) -> Result<Hash, ReadError>
The root of the final state trie of the block.
Sourcepub fn receipts_root(&self) -> Result<Hash, ReadError>
pub fn receipts_root(&self) -> Result<Hash, ReadError>
The root of the receipts trie of the block.
Sourcepub fn miner(&self) -> Result<Address, ReadError>
pub fn miner(&self) -> Result<Address, ReadError>
The address of the beneficiary to whom the mining rewards were given.
Sourcepub fn total_difficulty(&self) -> Result<Option<Quantity>, ReadError>
pub fn total_difficulty(&self) -> Result<Option<Quantity>, ReadError>
The total difficulty of the chain until this block.
Sourcepub fn extra_data(&self) -> Result<Data, ReadError>
pub fn extra_data(&self) -> Result<Data, ReadError>
The “extra data” field of this block.
Sourcepub fn gas_used(&self) -> Result<Quantity, ReadError>
pub fn gas_used(&self) -> Result<Quantity, ReadError>
The total used gas by all transactions in this block.
Sourcepub fn timestamp(&self) -> Result<Quantity, ReadError>
pub fn timestamp(&self) -> Result<Quantity, ReadError>
The unix timestamp for when the block was collated.
Sourcepub fn uncles(&self) -> Result<Option<Vec<FixedSizeData<32>>>, ReadError>
pub fn uncles(&self) -> Result<Option<Vec<FixedSizeData<32>>>, ReadError>
Array of uncle hashes.
Sourcepub fn blob_gas_used(&self) -> Result<Option<Quantity>, ReadError>
pub fn blob_gas_used(&self) -> Result<Option<Quantity>, ReadError>
The total amount of blob gas consumed by the transactions in the block.
Sourcepub fn excess_blob_gas(&self) -> Result<Option<Quantity>, ReadError>
pub fn excess_blob_gas(&self) -> Result<Option<Quantity>, ReadError>
A running total of blob gas consumed in excess of the target.
Sourcepub fn parent_beacon_block_root(&self) -> Result<Option<Hash>, ReadError>
pub fn parent_beacon_block_root(&self) -> Result<Option<Hash>, ReadError>
The hash of the parent beacon block.
Sourcepub fn withdrawals_root(&self) -> Result<Option<Hash>, ReadError>
pub fn withdrawals_root(&self) -> Result<Option<Hash>, ReadError>
The root of the withdrawal trie.
Sourcepub fn withdrawals(&self) -> Result<Option<Vec<Withdrawal>>, ReadError>
pub fn withdrawals(&self) -> Result<Option<Vec<Withdrawal>>, ReadError>
The withdrawals in the block.
Sourcepub fn l1_block_number(&self) -> Result<Option<BlockNumber>, ReadError>
pub fn l1_block_number(&self) -> Result<Option<BlockNumber>, ReadError>
The L1 block number.
Trait Implementations§
Source§impl<'a> From<ArrowRowReader<'a>> for BlockReader<'a>
impl<'a> From<ArrowRowReader<'a>> for BlockReader<'a>
Source§fn from(inner: ArrowRowReader<'a>) -> Self
fn from(inner: ArrowRowReader<'a>) -> Self
Auto Trait Implementations§
impl<'a> Freeze for BlockReader<'a>
impl<'a> !RefUnwindSafe for BlockReader<'a>
impl<'a> Send for BlockReader<'a>
impl<'a> Sync for BlockReader<'a>
impl<'a> Unpin for BlockReader<'a>
impl<'a> !UnwindSafe for BlockReader<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more