Enum odra_modules::cep78::modalities::MetadataMutability

source ·
#[repr(u8)]
pub enum MetadataMutability { Immutable = 0, Mutable = 1, }
Expand description

The metadata mutability mode governs the behavior around updates to a given NFTs metadata.

The Mutable option cannot be used in conjunction with the Hash modality for the NFT identifier; attempting to install the contract with this configuration raises super::error::CEP78Error::InvalidMetadataMutability error.

This modality is a required installation parameter and cannot be changed once the contract has been installed.

Variants§

§

Immutable = 0

Metadata for NFTs minted in this mode cannot be updated once the NFT has been minted.

§

Mutable = 1

Metadata for NFTs minted in this mode can update the metadata via the set_token_metadata entrypoint.

Trait Implementations§

source§

impl CLTyped for MetadataMutability

source§

fn cl_type() -> CLType

The CLType of Self.
source§

impl Clone for MetadataMutability

source§

fn clone(&self) -> MetadataMutability

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MetadataMutability

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MetadataMutability

source§

fn default() -> MetadataMutability

Returns the “default value” for a type. Read more
source§

impl FromBytes for MetadataMutability

source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Deserializes the slice into Self.
source§

fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>

Deserializes the Vec<u8> into Self.
source§

impl HasEvents for MetadataMutability

source§

fn events() -> Vec<Event>

Returns a list of Events used by the contract.
source§

fn event_schemas() -> BTreeMap<String, Schema>

Returns a map of event schemas used by the contract.
source§

impl NamedCLTyped for MetadataMutability

source§

fn ty() -> NamedCLType

Returns the NamedCLType of the implementing type.
source§

impl Ord for MetadataMutability

source§

fn cmp(&self, other: &MetadataMutability) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MetadataMutability

source§

fn eq(&self, other: &MetadataMutability) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MetadataMutability

source§

fn partial_cmp(&self, other: &MetadataMutability) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl SchemaCustomTypes for MetadataMutability

source§

fn schema_types() -> Vec<Option<CustomType>>

Returns a vector of optional CustomTypes.
source§

impl ToBytes for MetadataMutability

source§

fn to_bytes(&self) -> Result<Vec<u8>, Error>

Serializes &self to a Vec<u8>.
source§

fn serialized_length(&self) -> usize

Returns the length of the Vec<u8> which would be returned from a successful call to to_bytes() or into_bytes(). The data is not actually serialized, so this call is relatively cheap.
source§

fn into_bytes(self) -> Result<Vec<u8>, Error>
where Self: Sized,

Consumes self and serializes to a Vec<u8>.
source§

fn write_bytes(&self, writer: &mut Vec<u8>) -> Result<(), Error>

Writes &self into a mutable writer.
source§

impl TryFrom<u8> for MetadataMutability

§

type Error = CEP78Error

The type returned in the event of a conversion error.
source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for MetadataMutability

source§

impl Eq for MetadataMutability

source§

impl SchemaCustomElement for MetadataMutability

source§

impl StructuralPartialEq for MetadataMutability

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> EntrypointArgument for T
where T: CLTyped + ToBytes,

source§

fn is_required() -> bool

Returns true if the argument is required.
source§

fn cl_type() -> CLType

Returns the CLType of the argument.
source§

fn insert_runtime_arg(self, name: &str, args: &mut RuntimeArgs)

Inserts the argument into the runtime args.
source§

fn unwrap(value: Option<T>, env: &ContractEnv) -> T

Unwraps the argument from an Option.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SchemaErrors for T

source§

fn schema_errors() -> Vec<UserError>

Returns a vector of UserErrors.
source§

impl<T> SchemaEvents for T

source§

fn schema_events() -> Vec<Event>

Returns a vector of Events.
source§

fn custom_types() -> Vec<Option<CustomType>>

Returns a vector of CustomTypes. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.