pub struct FinalizeGlobalState { /* private fields */ }
Implementations§
source§impl FinalizeGlobalState
impl FinalizeGlobalState
sourcepub fn new_genesis<N: Network>() -> Result<Self>
pub fn new_genesis<N: Network>() -> Result<Self>
Initializes a new genesis global state.
sourcepub fn new<N: Network>(
block_round: u64,
block_height: u32,
block_cumulative_weight: u128,
block_cumulative_proof_target: u128,
previous_block_hash: N::BlockHash
) -> Result<Self>
pub fn new<N: Network>( block_round: u64, block_height: u32, block_cumulative_weight: u128, block_cumulative_proof_target: u128, previous_block_hash: N::BlockHash ) -> Result<Self>
Initializes a new global state from the given inputs.
sourcepub const fn from(
block_round: u64,
block_height: u32,
random_seed: [u8; 32]
) -> Self
pub const fn from( block_round: u64, block_height: u32, random_seed: [u8; 32] ) -> Self
Initializes a new global state.
sourcepub const fn block_round(&self) -> u64
pub const fn block_round(&self) -> u64
Returns the block round.
sourcepub const fn block_height(&self) -> u32
pub const fn block_height(&self) -> u32
Returns the block height.
sourcepub const fn random_seed(&self) -> &[u8; 32]
pub const fn random_seed(&self) -> &[u8; 32]
Returns the random seed.
Trait Implementations§
source§impl Clone for FinalizeGlobalState
impl Clone for FinalizeGlobalState
source§fn clone(&self) -> FinalizeGlobalState
fn clone(&self) -> FinalizeGlobalState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FinalizeGlobalState
impl Debug for FinalizeGlobalState
source§impl PartialEq for FinalizeGlobalState
impl PartialEq for FinalizeGlobalState
source§fn eq(&self, other: &FinalizeGlobalState) -> bool
fn eq(&self, other: &FinalizeGlobalState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for FinalizeGlobalState
impl Eq for FinalizeGlobalState
impl StructuralEq for FinalizeGlobalState
impl StructuralPartialEq for FinalizeGlobalState
Auto Trait Implementations§
impl RefUnwindSafe for FinalizeGlobalState
impl Send for FinalizeGlobalState
impl Sync for FinalizeGlobalState
impl Unpin for FinalizeGlobalState
impl UnwindSafe for FinalizeGlobalState
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.