Struct cardano_serialization_lib::HeaderBody
source · [−]pub struct HeaderBody { /* private fields */ }
Implementations
sourceimpl HeaderBody
impl HeaderBody
pub fn from_bytes(bytes: Vec<u8>) -> Result<HeaderBody, DeserializeError>
sourceimpl HeaderBody
impl HeaderBody
sourceimpl HeaderBody
impl HeaderBody
pub fn from_hex(hex_str: &str) -> Result<HeaderBody, DeserializeError>
sourceimpl HeaderBody
impl HeaderBody
sourceimpl 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>
Possible boundary error. Use slot_bignum instead
!!! 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
Underlying value capacity of slot (BigNum u64) bigger then Slot32. Use new_bignum instead.
!!! 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
sourceimpl Clone for HeaderBody
impl Clone for HeaderBody
sourcefn clone(&self) -> HeaderBody
fn clone(&self) -> HeaderBody
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for HeaderBody
impl Debug for HeaderBody
sourceimpl<'de> Deserialize<'de> for HeaderBody
impl<'de> Deserialize<'de> for HeaderBody
sourcefn 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
sourceimpl Deserialize for HeaderBody
impl Deserialize for HeaderBody
fn deserialize<R: BufRead + Seek>(
raw: &mut Deserializer<R>
) -> Result<Self, DeserializeError>
sourceimpl DeserializeEmbeddedGroup for HeaderBody
impl DeserializeEmbeddedGroup for HeaderBody
fn deserialize_as_embedded_group<R: BufRead + Seek>(
raw: &mut Deserializer<R>,
len: Len
) -> Result<Self, DeserializeError>
sourceimpl JsonSchema for HeaderBody
impl JsonSchema for HeaderBody
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn 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 more
sourceimpl PartialEq<HeaderBody> for HeaderBody
impl PartialEq<HeaderBody> for HeaderBody
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &HeaderBody) -> bool
fn ne(&self, other: &HeaderBody) -> bool
This method tests for !=
.
sourceimpl Serialize for HeaderBody
impl Serialize for HeaderBody
fn serialize<'se, W: Write>(
&self,
serializer: &'se mut Serializer<W>
) -> Result<&'se mut Serializer<W>>
sourceimpl Serialize for HeaderBody
impl Serialize for HeaderBody
impl Eq for HeaderBody
impl StructuralEq for HeaderBody
impl StructuralPartialEq for HeaderBody
Auto Trait Implementations
impl RefUnwindSafe for HeaderBody
impl Send for HeaderBody
impl Sync for HeaderBody
impl Unpin for HeaderBody
impl UnwindSafe for HeaderBody
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more