Struct cardano_serialization_lib::HeaderBody
source · pub struct HeaderBody { /* private fields */ }
Implementations§
source§impl HeaderBody
impl HeaderBody
pub fn from_bytes(bytes: Vec<u8>) -> Result<HeaderBody, DeserializeError>
source§impl HeaderBody
impl HeaderBody
pub fn from_hex(hex_str: &str) -> Result<HeaderBody, DeserializeError>
source§impl HeaderBody
impl HeaderBody
source§impl HeaderBody
impl HeaderBody
pub fn block_number(&self) -> u32
sourcepub fn slot(&self) -> Result<u32, JsError>
👎Deprecated since 10.1.0: Possible boundary error. Use slot_bignum instead
pub fn slot(&self) -> Result<u32, JsError>
!!! DEPRECATED !!! Returns a Slot32 (u32) value in case the underlying original BigNum (u64) value is within the limits. Otherwise will just raise an error.
pub fn slot_bignum(&self) -> BigNum
pub fn prev_hash(&self) -> Option<BlockHash>
pub fn issuer_vkey(&self) -> Vkey
pub fn vrf_vkey(&self) -> VRFVKey
sourcepub fn has_nonce_and_leader_vrf(&self) -> bool
pub fn has_nonce_and_leader_vrf(&self) -> bool
If this function returns true, the .nonce_vrf_or_nothing
and the .leader_vrf_or_nothing
functions will return
non-empty results
sourcepub fn nonce_vrf_or_nothing(&self) -> Option<VRFCert>
pub fn nonce_vrf_or_nothing(&self) -> Option<VRFCert>
Might return nothing in case .has_nonce_and_leader_vrf
returns false
sourcepub fn leader_vrf_or_nothing(&self) -> Option<VRFCert>
pub fn leader_vrf_or_nothing(&self) -> Option<VRFCert>
Might return nothing in case .has_nonce_and_leader_vrf
returns false
sourcepub fn has_vrf_result(&self) -> bool
pub fn has_vrf_result(&self) -> bool
If this function returns true, the .vrf_result_or_nothing
function will return a non-empty result
sourcepub fn vrf_result_or_nothing(&self) -> Option<VRFCert>
pub fn vrf_result_or_nothing(&self) -> Option<VRFCert>
Might return nothing in case .has_vrf_result
returns false
pub fn block_body_size(&self) -> u32
pub fn block_body_hash(&self) -> BlockHash
pub fn operational_cert(&self) -> OperationalCert
pub fn protocol_version(&self) -> ProtocolVersion
sourcepub fn new(
block_number: u32,
slot: u32,
prev_hash: Option<BlockHash>,
issuer_vkey: &Vkey,
vrf_vkey: &VRFVKey,
vrf_result: &VRFCert,
block_body_size: u32,
block_body_hash: &BlockHash,
operational_cert: &OperationalCert,
protocol_version: &ProtocolVersion
) -> Self
👎Deprecated since 10.1.0: Underlying value capacity of slot (BigNum u64) bigger then Slot32. Use new_bignum instead.
pub fn new(
block_number: u32,
slot: u32,
prev_hash: Option<BlockHash>,
issuer_vkey: &Vkey,
vrf_vkey: &VRFVKey,
vrf_result: &VRFCert,
block_body_size: u32,
block_body_hash: &BlockHash,
operational_cert: &OperationalCert,
protocol_version: &ProtocolVersion
) -> Self
!!! DEPRECATED !!!
This constructor uses outdated slot number format.
Use .new_headerbody
instead
pub fn new_headerbody(
block_number: u32,
slot: &BigNum,
prev_hash: Option<BlockHash>,
issuer_vkey: &Vkey,
vrf_vkey: &VRFVKey,
vrf_result: &VRFCert,
block_body_size: u32,
block_body_hash: &BlockHash,
operational_cert: &OperationalCert,
protocol_version: &ProtocolVersion
) -> Self
Trait Implementations§
source§impl Clone for HeaderBody
impl Clone for HeaderBody
source§fn clone(&self) -> HeaderBody
fn clone(&self) -> HeaderBody
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 HeaderBody
impl Debug for HeaderBody
source§impl<'de> Deserialize<'de> for HeaderBody
impl<'de> Deserialize<'de> for HeaderBody
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 Deserialize for HeaderBody
impl Deserialize for HeaderBody
fn deserialize<R: BufRead + Seek>(
raw: &mut Deserializer<R>
) -> Result<Self, DeserializeError>
source§impl DeserializeEmbeddedGroup for HeaderBody
impl DeserializeEmbeddedGroup for HeaderBody
fn deserialize_as_embedded_group<R: BufRead + Seek>(
raw: &mut Deserializer<R>,
len: Len
) -> Result<Self, DeserializeError>
source§impl JsonSchema for HeaderBody
impl JsonSchema for HeaderBody
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq<HeaderBody> for HeaderBody
impl PartialEq<HeaderBody> for HeaderBody
source§fn eq(&self, other: &HeaderBody) -> bool
fn eq(&self, other: &HeaderBody) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.