Struct cml_chain_wasm::Script
source · pub struct Script(/* private fields */);
Implementations§
source§impl Script
impl Script
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<Script, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<Script, 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.
source§impl Script
impl Script
pub fn new_native(script: &NativeScript) -> Self
pub fn new_plutus_v1(script: &PlutusV1Script) -> Self
pub fn new_plutus_v2(script: &PlutusV2Script) -> Self
pub fn new_plutus_v3(script: &PlutusV3Script) -> Self
pub fn kind(&self) -> ScriptKind
pub fn as_native(&self) -> Option<NativeScript>
pub fn as_plutus_v1(&self) -> Option<PlutusV1Script>
pub fn as_plutus_v2(&self) -> Option<PlutusV2Script>
pub fn as_plutus_v3(&self) -> Option<PlutusV3Script>
Trait Implementations§
source§impl FromWasmAbi for Script
impl FromWasmAbi for Script
source§impl IntoWasmAbi for Script
impl IntoWasmAbi for Script
source§impl OptionFromWasmAbi for Script
impl OptionFromWasmAbi for Script
source§impl OptionIntoWasmAbi for Script
impl OptionIntoWasmAbi for Script
source§impl RefFromWasmAbi for Script
impl RefFromWasmAbi for Script
source§impl RefMutFromWasmAbi for Script
impl RefMutFromWasmAbi for Script
Auto Trait Implementations§
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnwindSafe for Script
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
.