pub struct Header {Show 13 fields
pub hash: Hash,
pub version: u16,
pub parents_by_level: Vec<Vec<Hash>>,
pub hash_merkle_root: Hash,
pub accepted_id_merkle_root: Hash,
pub utxo_commitment: Hash,
pub timestamp: u64,
pub bits: u32,
pub nonce: u64,
pub daa_score: u64,
pub blue_work: BlueWorkType,
pub blue_score: u64,
pub pruning_point: Hash,
}Expand description
@category Consensus
Fields§
§hash: HashCached hash
version: u16§parents_by_level: Vec<Vec<Hash>>§hash_merkle_root: Hash§accepted_id_merkle_root: Hash§utxo_commitment: Hash§timestamp: u64Timestamp is in milliseconds
bits: u32§nonce: u64§daa_score: u64§blue_work: BlueWorkType§blue_score: u64§pruning_point: HashImplementations§
Source§impl Header
impl Header
pub fn new_finalized( version: u16, parents_by_level: Vec<Vec<Hash>>, hash_merkle_root: Hash, accepted_id_merkle_root: Hash, utxo_commitment: Hash, timestamp: u64, bits: u32, nonce: u64, daa_score: u64, blue_work: BlueWorkType, blue_score: u64, pruning_point: Hash, ) -> Self
pub fn direct_parents(&self) -> &[Hash]
Trait Implementations§
Source§impl BorshDeserialize for Header
impl BorshDeserialize for Header
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for Header
impl BorshSerialize for Header
Source§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
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
Source§impl From<&GenesisBlock> for Header
impl From<&GenesisBlock> for Header
Source§fn from(genesis: &GenesisBlock) -> Self
fn from(genesis: &GenesisBlock) -> Self
Converts to this type from the input type.
Source§impl From<Header> for DaaScoreTimestamp
impl From<Header> for DaaScoreTimestamp
Source§fn from(header: Header) -> DaaScoreTimestamp
fn from(header: Header) -> DaaScoreTimestamp
Converts to this type from the input type.
Source§impl MemSizeEstimator for Header
impl MemSizeEstimator for Header
Source§fn estimate_mem_bytes(&self) -> usize
fn estimate_mem_bytes(&self) -> usize
Estimates the (deep) size of this object in bytes (including heap owned inner data)
Source§fn estimate_size(&self, mem_mode: MemMode) -> usize
fn estimate_size(&self, mem_mode: MemMode) -> usize
Estimates the size of this object depending on the passed mem mode
Source§fn estimate_mem_units(&self) -> usize
fn estimate_mem_units(&self) -> usize
Estimates the number of units this object holds in memory where the unit byte size is usually
a constant known to the caller as well (and hence we avoid computing it over and over)
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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)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