Struct cml_core_wasm::metadata::Metadata
source · pub struct Metadata(/* private fields */);
Implementations§
source§impl Metadata
impl Metadata
pub fn new() -> Self
sourcepub fn set(
&mut self,
key: TransactionMetadatumLabel,
value: &TransactionMetadatum
)
pub fn set( &mut self, key: TransactionMetadatumLabel, value: &TransactionMetadatum )
Replaces all metadatums of a given label, if any exist.
sourcepub fn get(
&self,
label: TransactionMetadatumLabel
) -> Option<TransactionMetadatum>
pub fn get( &self, label: TransactionMetadatumLabel ) -> Option<TransactionMetadatum>
Gets the Metadatum corresponding to a given label, if it exists. Note: In the case of duplicate labels this only returns the first metadatum. This is an extremely rare occurence on-chain but can happen.
sourcepub fn get_all(
&self,
label: TransactionMetadatumLabel
) -> Option<TransactionMetadatumList>
pub fn get_all( &self, label: TransactionMetadatumLabel ) -> Option<TransactionMetadatumList>
In the extremely unlikely situation there are duplicate labels, this gets all of a single label
pub fn labels(&self) -> TransactionMetadatumLabels
Trait Implementations§
source§impl FromWasmAbi for Metadata
impl FromWasmAbi for Metadata
source§impl IntoWasmAbi for Metadata
impl IntoWasmAbi for Metadata
source§impl OptionFromWasmAbi for Metadata
impl OptionFromWasmAbi for Metadata
source§impl OptionIntoWasmAbi for Metadata
impl OptionIntoWasmAbi for Metadata
source§impl RefFromWasmAbi for Metadata
impl RefFromWasmAbi for Metadata
source§impl RefMutFromWasmAbi for Metadata
impl RefMutFromWasmAbi for Metadata
Auto Trait Implementations§
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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
.