pub struct Block {
pub height: u64,
pub hash: String,
pub previous_hash: String,
pub timestamp: u64,
pub nonce: u64,
pub difficulty: u32,
pub miner: String,
pub transactions: Vec<Transaction>,
}Expand description
Minimal block representation aligned with .AI3 core::Block.
Fields§
§height: u64Block height (genesis = 0).
hash: StringSHA-256 hash of the block header and transactions.
previous_hash: StringHash of the previous block.
timestamp: u64Unix timestamp.
nonce: u64Proof nonce.
difficulty: u32Mining difficulty target.
miner: StringMiner address or identifier.
transactions: Vec<Transaction>Transactions included in this block.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Block
impl<'de> Deserialize<'de> for Block
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 Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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