Struct cml_chain_wasm::crypto::ScriptHash
source · pub struct ScriptHash(/* private fields */);
Implementations§
source§impl ScriptHash
impl ScriptHash
pub fn to_raw_bytes(&self) -> Vec<u8>
pub fn to_bech32(&self, prefix: &str) -> Result<String, JsError>
pub fn to_hex(&self) -> String
pub fn from_bech32(bech32_str: &str) -> Result<ScriptHash, JsError>
pub fn from_hex(input: &str) -> Result<ScriptHash, JsError>
pub fn from_raw_bytes(bytes: &[u8]) -> Result<ScriptHash, JsError>
Trait Implementations§
source§impl AsRef<ScriptHash> for ScriptHash
impl AsRef<ScriptHash> for ScriptHash
source§fn as_ref(&self) -> &ScriptHash
fn as_ref(&self) -> &ScriptHash
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for ScriptHash
impl Clone for ScriptHash
source§fn clone(&self) -> ScriptHash
fn clone(&self) -> ScriptHash
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 ScriptHash
impl Debug for ScriptHash
source§impl From<ScriptHash> for JsValue
impl From<ScriptHash> for JsValue
source§fn from(value: ScriptHash) -> JsValue
fn from(value: ScriptHash) -> JsValue
Converts to this type from the input type.
source§impl From<ScriptHash> for ScriptHash
impl From<ScriptHash> for ScriptHash
source§fn from(inner: ScriptHash) -> ScriptHash
fn from(inner: ScriptHash) -> ScriptHash
Converts to this type from the input type.
source§impl FromWasmAbi for ScriptHash
impl FromWasmAbi for ScriptHash
source§impl IntoWasmAbi for ScriptHash
impl IntoWasmAbi for ScriptHash
source§impl OptionFromWasmAbi for ScriptHash
impl OptionFromWasmAbi for ScriptHash
source§fn is_none(abi: &<ScriptHash as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<ScriptHash as FromWasmAbi>::Abi) -> bool
Tests whether the argument is a “none” instance. If so it will be
deserialized as
None
, and otherwise it will be passed to
FromWasmAbi
.source§impl OptionIntoWasmAbi for ScriptHash
impl OptionIntoWasmAbi for ScriptHash
source§fn none() -> <ScriptHash as IntoWasmAbi>::Abi
fn none() -> <ScriptHash as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None
branch of this option. Read moresource§impl RefFromWasmAbi for ScriptHash
impl RefFromWasmAbi for ScriptHash
§type Anchor = Ref<'static, ScriptHash>
type Anchor = Ref<'static, ScriptHash>
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§unsafe fn ref_from_abi(
js: <ScriptHash as RefFromWasmAbi>::Abi
) -> <ScriptHash as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <ScriptHash as RefFromWasmAbi>::Abi ) -> <ScriptHash as RefFromWasmAbi>::Anchor
source§impl RefMutFromWasmAbi for ScriptHash
impl RefMutFromWasmAbi for ScriptHash
§type Anchor = RefMut<'static, ScriptHash>
type Anchor = RefMut<'static, ScriptHash>
Same as
RefFromWasmAbi::Anchor
source§unsafe fn ref_mut_from_abi(
js: <ScriptHash as RefMutFromWasmAbi>::Abi
) -> <ScriptHash as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <ScriptHash as RefMutFromWasmAbi>::Abi ) -> <ScriptHash as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Auto Trait Implementations§
impl RefUnwindSafe for ScriptHash
impl Send for ScriptHash
impl Sync for ScriptHash
impl Unpin for ScriptHash
impl UnwindSafe for ScriptHash
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
.