pub struct Block {
pub hash: String,
pub timestamp: u64,
pub height: u32,
pub chain_from: u8,
pub chain_to: u8,
pub transactions: Vec<BlockTransaction>,
pub parent_hash: String,
pub nonce: String,
}Expand description
Block with transactions
Fields§
§hash: String§timestamp: u64§height: u32§chain_from: u8§chain_to: u8§transactions: Vec<BlockTransaction>§parent_hash: String§nonce: StringImplementations§
Source§impl Block
impl Block
Sourcepub fn transaction_count(&self) -> usize
pub fn transaction_count(&self) -> usize
Get transaction count
Sourcepub fn is_from_chain(&self, chain: u8) -> bool
pub fn is_from_chain(&self, chain: u8) -> bool
Check if block is from specific chain
Sourcepub fn is_to_chain(&self, chain: u8) -> bool
pub fn is_to_chain(&self, chain: u8) -> bool
Check if block is to specific chain
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