pub struct BabbageScript(/* private fields */);Implementations§
Source§impl BabbageScript
impl BabbageScript
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<BabbageScript, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<BabbageScript, 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<BabbageScript, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<BabbageScript, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
Source§impl BabbageScript
impl BabbageScript
Source§impl BabbageScript
impl BabbageScript
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 kind(&self) -> BabbageScriptKind
pub fn as_native(&self) -> Option<NativeScript>
pub fn as_plutus_v1(&self) -> Option<PlutusV1Script>
pub fn as_plutus_v2(&self) -> Option<PlutusV2Script>
Trait Implementations§
Source§impl AsRef<BabbageScript> for BabbageScript
impl AsRef<BabbageScript> for BabbageScript
Source§fn as_ref(&self) -> &BabbageScript
fn as_ref(&self) -> &BabbageScript
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for BabbageScript
impl Clone for BabbageScript
Source§fn clone(&self) -> BabbageScript
fn clone(&self) -> BabbageScript
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 BabbageScript
impl Debug for BabbageScript
Source§impl From<BabbageScript> for BabbageScript
impl From<BabbageScript> for BabbageScript
Source§fn from(native: BabbageScript) -> Self
fn from(native: BabbageScript) -> Self
Converts to this type from the input type.
Source§impl From<BabbageScript> for JsValue
impl From<BabbageScript> for JsValue
Source§fn from(value: BabbageScript) -> Self
fn from(value: BabbageScript) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for BabbageScript
impl FromWasmAbi for BabbageScript
Source§impl Into<BabbageScript> for BabbageScript
impl Into<BabbageScript> for BabbageScript
Source§fn into(self) -> BabbageScript
fn into(self) -> BabbageScript
Converts this type into the (usually inferred) input type.
Source§impl IntoWasmAbi for BabbageScript
impl IntoWasmAbi for BabbageScript
Source§impl LongRefFromWasmAbi for BabbageScript
impl LongRefFromWasmAbi for BabbageScript
Source§impl OptionFromWasmAbi for BabbageScript
impl OptionFromWasmAbi for BabbageScript
Source§impl OptionIntoWasmAbi for BabbageScript
impl OptionIntoWasmAbi for BabbageScript
Source§impl RefFromWasmAbi for BabbageScript
impl RefFromWasmAbi for BabbageScript
Source§type Anchor = RcRef<BabbageScript>
type Anchor = RcRef<BabbageScript>
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 BabbageScript
impl RefMutFromWasmAbi for BabbageScript
Source§impl TryFromJsValue for BabbageScript
impl TryFromJsValue for BabbageScript
Source§impl VectorFromWasmAbi for BabbageScript
impl VectorFromWasmAbi for BabbageScript
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[BabbageScript]>
Source§impl VectorIntoWasmAbi for BabbageScript
impl VectorIntoWasmAbi for BabbageScript
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[BabbageScript]>) -> Self::Abi
Source§impl WasmDescribeVector for BabbageScript
impl WasmDescribeVector for BabbageScript
impl SupportsConstructor for BabbageScript
impl SupportsInstanceProperty for BabbageScript
impl SupportsStaticProperty for BabbageScript
Auto Trait Implementations§
impl Freeze for BabbageScript
impl RefUnwindSafe for BabbageScript
impl Send for BabbageScript
impl Sync for BabbageScript
impl Unpin for BabbageScript
impl UnsafeUnpin for BabbageScript
impl UnwindSafe for BabbageScript
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.