pub struct BlockInfo {
pub block_height: u64,
pub block_hash: String,
pub first_version: u64,
pub last_version: u64,
pub timestamp: u64,
pub transaction_count: usize,
pub transactions: Option<Vec<TransactionInfo>>,
}Fields§
§block_height: u64Block height
block_hash: StringBlock hash
first_version: u64First version in block
last_version: u64Last version in block
timestamp: u64Block timestamp in microseconds since epoch
transaction_count: usizeTransaction count in block
transactions: Option<Vec<TransactionInfo>>Block transactions
Implementations§
Source§impl BlockInfo
impl BlockInfo
Sourcepub fn from_aptos_block(block: &Block) -> Self
pub fn from_aptos_block(block: &Block) -> Self
Convert from Aptos Block
Sourcepub fn from_aptos_block_with_txs(
block: &Block,
transactions: Vec<TransactionInfo>,
) -> Self
pub fn from_aptos_block_with_txs( block: &Block, transactions: Vec<TransactionInfo>, ) -> Self
Convert from Aptos Block with full transactions
Sourcepub fn timestamp_seconds(&self) -> f64
pub fn timestamp_seconds(&self) -> f64
Get block timestamp in seconds
Sourcepub fn timestamp_millis(&self) -> u64
pub fn timestamp_millis(&self) -> u64
Get block timestamp in milliseconds
Sourcepub fn block_time_seconds(&self) -> Option<f64>
pub fn block_time_seconds(&self) -> Option<f64>
Get block time in seconds
Sourcepub fn has_transactions(&self) -> bool
pub fn has_transactions(&self) -> bool
Check if block contains transactions
Sourcepub fn transaction_version_range(&self) -> (u64, u64)
pub fn transaction_version_range(&self) -> (u64, u64)
Get transaction version range
Sourcepub fn estimated_size(&self) -> usize
pub fn estimated_size(&self) -> usize
Calculate block size (approximation)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BlockInfo
impl<'de> Deserialize<'de> for BlockInfo
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
Auto Trait Implementations§
impl Freeze for BlockInfo
impl RefUnwindSafe for BlockInfo
impl Send for BlockInfo
impl Sync for BlockInfo
impl Unpin for BlockInfo
impl UnwindSafe for BlockInfo
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)