Enum jormungandr::blockcfg::Header
source · pub enum Header {
Unsigned(HeaderUnsigned),
GenesisPraos(HeaderGenesisPraos),
Bft(HeaderBft),
}
Variants§
Implementations§
source§impl Header
impl Header
pub fn id(&self) -> Hash
pub fn size(&self) -> NonZeroUsize
pub fn hash(&self) -> Hash
pub fn description(&self) -> HeaderDesc
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_auth_slice(&self) -> &[u8] ⓘ
pub fn block_version(&self) -> BlockVersion
pub fn block_date(&self) -> BlockDate
pub fn block_content_hash(&self) -> Hash
pub fn block_content_size(&self) -> u32
pub fn block_parent_hash(&self) -> Hash
pub fn chain_length(&self) -> ChainLength
pub fn from_slice(slice: &[u8]) -> Result<Header, HeaderError>
pub fn to_raw(&self) -> Box<[u8], Global>
pub fn common(&self) -> Common
pub fn proof(&self) -> Proof
pub fn get_stakepool_id(&self) -> Option<DigestOf<Blake2b256, PoolRegistration>>
pub fn get_bft_leader_id(&self) -> Option<BftLeaderId>
pub fn get_consensus_eval_context(&self) -> ConsensusEvalContext
pub fn get_content_eval_context(&self) -> HeaderContentEvalContext
Trait Implementations§
source§impl Deserialize for Header
impl Deserialize for Header
source§impl Header for Header
impl Header for Header
§type Version = BlockVersion
type Version = BlockVersion
the type associated to the version of a block
§type ChainLength = ChainLength
type ChainLength = ChainLength
the length of the blockchain (number of blocks)
source§fn parent_id(&self) -> <Header as Header>::Id
fn parent_id(&self) -> <Header as Header>::Id
get the parent block identifier (the previous block in the
blockchain).
source§fn chain_length(&self) -> <Header as Header>::ChainLength
fn chain_length(&self) -> <Header as Header>::ChainLength
get the block’s chain length. The number of block
created following this thread of blocks on the blockchain
(including Self).
source§impl PartialEq<Header> for Header
impl PartialEq<Header> for Header
source§impl Serialize for Header
impl Serialize for Header
source§fn serialized_size(&self) -> usize
fn serialized_size(&self) -> usize
Default implementation, not efficient, not recommended to use it
fn serialize<W>(&self, codec: &mut Codec<W>) -> Result<(), WriteError>where W: Write,
source§fn serialize_as_vec(&self) -> Result<Vec<u8, Global>, WriteError>
fn serialize_as_vec(&self) -> Result<Vec<u8, Global>, WriteError>
Convenience method to serialize into a byte vector.
impl Eq for Header
impl StructuralEq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin 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> DeserializeFromSlice for Twhere
T: Deserialize,
impl<T> DeserializeFromSlice for Twhere T: Deserialize,
source§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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
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