Struct cml_chain_wasm::certs::Credential
source · pub struct Credential(/* private fields */);Implementations§
source§impl Credential
impl Credential
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<Credential, JsError>
pub fn from_cbor_bytes(cbor_bytes: &[u8]) -> Result<Credential, 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<Credential, JsError>
pub fn from_cbor_hex(cbor_bytes: &str) -> Result<Credential, JsError>
- Create this type from the CBOR bytes encoded as a hex string.
- This is useful for interfacing with CIP30
source§impl Credential
impl Credential
source§impl Credential
impl Credential
pub fn new_pub_key(hash: &Ed25519KeyHash) -> Self
pub fn new_script(hash: &ScriptHash) -> Self
pub fn kind(&self) -> CredentialKind
pub fn as_pub_key(&self) -> Option<Ed25519KeyHash>
pub fn as_script(&self) -> Option<ScriptHash>
Trait Implementations§
source§impl AsRef<Credential> for Credential
impl AsRef<Credential> for Credential
source§fn as_ref(&self) -> &Credential
fn as_ref(&self) -> &Credential
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for Credential
impl Clone for Credential
source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
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 Credential
impl Debug for Credential
source§impl From<Credential> for Credential
impl From<Credential> for Credential
source§fn from(native: Credential) -> Self
fn from(native: Credential) -> Self
Converts to this type from the input type.
source§impl From<Credential> for JsValue
impl From<Credential> for JsValue
source§fn from(value: Credential) -> Self
fn from(value: Credential) -> Self
Converts to this type from the input type.
source§impl FromWasmAbi for Credential
impl FromWasmAbi for Credential
source§impl Into<Credential> for Credential
impl Into<Credential> for Credential
source§fn into(self) -> Credential
fn into(self) -> Credential
Converts this type into the (usually inferred) input type.
source§impl IntoWasmAbi for Credential
impl IntoWasmAbi for Credential
source§impl OptionFromWasmAbi for Credential
impl OptionFromWasmAbi for Credential
source§impl OptionIntoWasmAbi for Credential
impl OptionIntoWasmAbi for Credential
source§impl RefFromWasmAbi for Credential
impl RefFromWasmAbi for Credential
§type Anchor = Ref<'static, Credential>
type Anchor = Ref<'static, Credential>
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 Credential
impl RefMutFromWasmAbi for Credential
Auto Trait Implementations§
impl Freeze for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnwindSafe for Credential
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> 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,
§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.