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
impl Copy for FinalizeGlobalState
impl Eq for FinalizeGlobalState
impl StructuralPartialEq for FinalizeGlobalState
Auto Trait Implementations§
impl Freeze for FinalizeGlobalState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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