pub struct HeaderBody(/* private fields */);Implementations§
Source§impl HeaderBody
impl HeaderBody
Sourcepub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
pub fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
- Serialize this type to CBOR bytes using canonical CBOR encodings
Sourcepub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<HeaderBody, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<HeaderBody, JsError>
- Create this type from CBOR bytes
Sourcepub fn to_cbor_hex(&self) -> String
pub fn to_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes encoded as a hex string (useful for working with CIP30).
- This type type supports encoding preservation so this will preserve round-trip CBOR formats.
- If created from scratch the CBOR will be canonical.
Sourcepub fn to_canonical_cbor_hex(&self) -> String
pub fn to_canonical_cbor_hex(&self) -> String
- Serialize this type to CBOR bytes using canonical CBOR encodings as hex bytes
Sourcepub fn from_cbor_hex(cbor_bytes: &str) -> Result<HeaderBody, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<HeaderBody, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
Source§impl HeaderBody
impl HeaderBody
Source§impl HeaderBody
impl HeaderBody
pub fn block_number(&self) -> u64
pub fn slot(&self) -> u64
pub fn prev_hash(&self) -> Option<BlockHeaderHash>
pub fn issuer_vkey(&self) -> Vkey
pub fn vrf_vkey(&self) -> VRFVkey
pub fn vrf_result(&self) -> VRFCert
pub fn block_body_size(&self) -> u64
pub fn block_body_hash(&self) -> BlockBodyHash
pub fn operational_cert(&self) -> OperationalCert
pub fn protocol_version(&self) -> ProtocolVersion
pub fn new( block_number: u64, slot: u64, prev_hash: Option<BlockHeaderHash>, issuer_vkey: &Vkey, vrf_vkey: &VRFVkey, vrf_result: &VRFCert, block_body_size: u64, block_body_hash: &BlockBodyHash, operational_cert: &OperationalCert, protocol_version: &ProtocolVersion, ) -> Self
Trait Implementations§
Source§impl AsRef<HeaderBody> for HeaderBody
impl AsRef<HeaderBody> for HeaderBody
Source§fn as_ref(&self) -> &HeaderBody
fn as_ref(&self) -> &HeaderBody
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for HeaderBody
impl Clone for HeaderBody
Source§fn clone(&self) -> HeaderBody
fn clone(&self) -> HeaderBody
Returns a duplicate 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 From<HeaderBody> for HeaderBody
impl From<HeaderBody> for HeaderBody
Source§fn from(native: HeaderBody) -> Self
fn from(native: HeaderBody) -> Self
Converts to this type from the input type.
Source§impl From<HeaderBody> for JsValue
impl From<HeaderBody> for JsValue
Source§fn from(value: HeaderBody) -> Self
fn from(value: HeaderBody) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for HeaderBody
impl FromWasmAbi for HeaderBody
Source§impl Into<HeaderBody> for HeaderBody
impl Into<HeaderBody> for HeaderBody
Source§fn into(self) -> HeaderBody
fn into(self) -> HeaderBody
Converts this type into the (usually inferred) input type.
Source§impl IntoWasmAbi for HeaderBody
impl IntoWasmAbi for HeaderBody
Source§impl LongRefFromWasmAbi for HeaderBody
impl LongRefFromWasmAbi for HeaderBody
Source§impl OptionFromWasmAbi for HeaderBody
impl OptionFromWasmAbi for HeaderBody
Source§impl OptionIntoWasmAbi for HeaderBody
impl OptionIntoWasmAbi for HeaderBody
Source§impl RefFromWasmAbi for HeaderBody
impl RefFromWasmAbi for HeaderBody
Source§type Anchor = RcRef<HeaderBody>
type Anchor = RcRef<HeaderBody>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for HeaderBody
impl RefMutFromWasmAbi for HeaderBody
Source§impl TryFromJsValue for HeaderBody
impl TryFromJsValue for HeaderBody
Source§impl VectorFromWasmAbi for HeaderBody
impl VectorFromWasmAbi for HeaderBody
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[HeaderBody]>
Source§impl VectorIntoWasmAbi for HeaderBody
impl VectorIntoWasmAbi for HeaderBody
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[HeaderBody]>) -> Self::Abi
Source§impl WasmDescribeVector for HeaderBody
impl WasmDescribeVector for HeaderBody
impl SupportsConstructor for HeaderBody
impl SupportsInstanceProperty for HeaderBody
impl SupportsStaticProperty 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.