Enum chain_impl_mockchain::header::Header
source · pub enum Header {
Unsigned(HeaderUnsigned),
GenesisPraos(HeaderGenesisPraos),
Bft(HeaderBft),
}
Variants§
Implementations§
source§impl Header
impl Header
pub fn id(&self) -> HeaderId
pub fn size(&self) -> NonZeroUsize
pub fn hash(&self) -> HeaderId
pub fn description(&self) -> HeaderDesc
fn get_cstruct(&self) -> HeaderSlice<'_>
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) -> BlockContentHash
pub fn block_content_size(&self) -> BlockContentSize
pub fn block_parent_hash(&self) -> HeaderId
pub fn chain_length(&self) -> ChainLength
pub fn from_slice(slice: &[u8]) -> Result<Header, HeaderError>
pub fn to_raw(&self) -> Box<[u8]>
pub fn common(&self) -> Common
pub fn proof(&self) -> Proof
pub fn get_stakepool_id(&self) -> Option<PoolId>
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
fn deserialize<R: Read>(codec: &mut Codec<R>) -> Result<Self, ReadError>
fn deserialize_validate<R>(codec: &mut Codec<R>) -> Result<(), ReadError>where R: Read,
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) -> Self::Id
fn parent_id(&self) -> Self::Id
get the parent block identifier (the previous block in the
blockchain).
source§fn chain_length(&self) -> Self::ChainLength
fn chain_length(&self) -> Self::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
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