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>
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§
Source§impl Clone for HeaderBody
impl Clone for HeaderBody
Source§fn clone(&self) -> HeaderBody
fn clone(&self) -> HeaderBody
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
impl Eq for HeaderBody
Source§impl JsonSchema for HeaderBody
impl JsonSchema for HeaderBody
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for HeaderBody
impl PartialEq for HeaderBody
Source§fn eq(&self, other: &HeaderBody) -> bool
fn eq(&self, other: &HeaderBody) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for HeaderBody
impl Serialize for HeaderBody
Source§impl Serialize for HeaderBody
impl Serialize for HeaderBody
fn serialize<'se, W: Write>( &self, serializer: &'se mut Serializer<W>, ) -> Result<&'se mut Serializer<W>>
impl StructuralPartialEq for HeaderBody
Auto Trait Implementations§
impl Freeze for HeaderBody
impl RefUnwindSafe for HeaderBody
impl Send for HeaderBody
impl Sync for HeaderBody
impl Unpin for HeaderBody
impl UnsafeUnpin for HeaderBody
impl UnwindSafe for HeaderBody
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more