pub struct Header {Show 24 fields
pub nonce: u64,
pub prev_hash: Bytes,
pub prev_rand_seed: Bytes,
pub rand_seed: Bytes,
pub pub_keys_bitmap: Bytes,
pub shard_id: u32,
pub time_stamp: u64,
pub round: u64,
pub epoch: u32,
pub block_body_type: i32,
pub signature: Bytes,
pub leader_signature: Bytes,
pub mini_block_headers: Vec<MiniBlockHeader>,
pub peer_changes: Vec<PeerChange>,
pub root_hash: Bytes,
pub meta_block_hashes: Vec<Bytes>,
pub tx_count: u32,
pub epoch_start_meta_hash: Bytes,
pub receipts_hash: Bytes,
pub chain_id: Bytes,
pub software_version: Bytes,
pub accumulated_fees: Bytes,
pub developer_fees: Bytes,
pub reserved: Bytes,
}Expand description
Header holds the metadata of a block. This is the part that is being hashed and run through consensus. The header holds the hash of the body and also the link to the previous block header hash
Fields§
§nonce: u64§prev_hash: Bytes§prev_rand_seed: Bytes§rand_seed: Bytes§pub_keys_bitmap: Bytes§shard_id: u32§time_stamp: u64§round: u64§epoch: u32§block_body_type: i32§signature: Bytes§leader_signature: Bytes§mini_block_headers: Vec<MiniBlockHeader>§peer_changes: Vec<PeerChange>§root_hash: Bytes§meta_block_hashes: Vec<Bytes>§tx_count: u32§epoch_start_meta_hash: Bytes§receipts_hash: Bytes§chain_id: Bytes§software_version: Bytes§accumulated_fees: Bytes§developer_fees: Bytes§reserved: BytesImplementations§
Source§impl Header
impl Header
Sourcepub fn block_body_type(&self) -> Type
pub fn block_body_type(&self) -> Type
Returns the enum value of block_body_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_block_body_type(&mut self, value: Type)
pub fn set_block_body_type(&mut self, value: Type)
Sets block_body_type to the provided enum value.
Trait Implementations§
Source§impl Message for Header
impl Message for Header
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for Header
Auto Trait Implementations§
impl !Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request