Struct cml_chain_wasm::plutus::PlutusData
source · pub struct PlutusData(/* private fields */);
Implementations§
source§impl PlutusData
impl PlutusData
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 from_cbor_bytes(cbor_bytes: &[u8]) -> Result<PlutusData, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<PlutusData, 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 from_cbor_hex(cbor_bytes: &str) -> Result<PlutusData, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<PlutusData, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
source§impl PlutusData
impl PlutusData
source§impl PlutusData
impl PlutusData
pub fn new_constr_plutus_data(constr_plutus_data: &ConstrPlutusData) -> Self
pub fn new_map(map: &PlutusMap) -> Self
pub fn new_list(list: &PlutusDataList) -> Self
pub fn new_integer(big_int: &BigInt) -> Self
pub fn new_bytes(bytes: Vec<u8>) -> Self
pub fn kind(&self) -> PlutusDataKind
pub fn as_constr_plutus_data(&self) -> Option<ConstrPlutusData>
pub fn as_map(&self) -> Option<PlutusMap>
pub fn as_list(&self) -> Option<PlutusDataList>
pub fn as_integer(&self) -> Option<BigInt>
pub fn as_bytes(&self) -> Option<Vec<u8>>
Trait Implementations§
source§impl AsRef<PlutusData> for PlutusData
impl AsRef<PlutusData> for PlutusData
source§fn as_ref(&self) -> &PlutusData
fn as_ref(&self) -> &PlutusData
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for PlutusData
impl Clone for PlutusData
source§fn clone(&self) -> PlutusData
fn clone(&self) -> PlutusData
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 PlutusData
impl Debug for PlutusData
source§impl From<PlutusData> for JsValue
impl From<PlutusData> for JsValue
source§fn from(value: PlutusData) -> Self
fn from(value: PlutusData) -> Self
Converts to this type from the input type.
source§impl From<PlutusData> for PlutusData
impl From<PlutusData> for PlutusData
source§fn from(native: PlutusData) -> Self
fn from(native: PlutusData) -> Self
Converts to this type from the input type.
source§impl FromWasmAbi for PlutusData
impl FromWasmAbi for PlutusData
source§impl Into<PlutusData> for PlutusData
impl Into<PlutusData> for PlutusData
source§fn into(self) -> PlutusData
fn into(self) -> PlutusData
Converts this type into the (usually inferred) input type.
source§impl IntoWasmAbi for PlutusData
impl IntoWasmAbi for PlutusData
source§impl OptionFromWasmAbi for PlutusData
impl OptionFromWasmAbi for PlutusData
source§impl OptionIntoWasmAbi for PlutusData
impl OptionIntoWasmAbi for PlutusData
source§impl RefFromWasmAbi for PlutusData
impl RefFromWasmAbi for PlutusData
§type Anchor = Ref<'static, PlutusData>
type Anchor = Ref<'static, PlutusData>
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 PlutusData
impl RefMutFromWasmAbi for PlutusData
Auto Trait Implementations§
impl RefUnwindSafe for PlutusData
impl Send for PlutusData
impl Sync for PlutusData
impl Unpin for PlutusData
impl UnwindSafe for PlutusData
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§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
.