pub struct ExtraCurrencyCollection(/* private fields */);
Expand description

Dictionary with amounts for multiple currencies.

Implementations§

source§

impl ExtraCurrencyCollection

source

pub const fn new() -> Self

Creates an empty extra currency collection.

source

pub const fn from_raw(dict: Option<Cell>) -> Self

Creates a currency collection from a raw cell.

source

pub const fn is_empty(&self) -> bool

Returns true if the dictionary contains no elements.

source

pub const fn as_dict(&self) -> &Dict<u32, VarUint248>

Returns a reference to the underlying dictionary.

source

pub fn as_dict_mut(&mut self) -> &mut Dict<u32, VarUint248>

Returns a mutable reference to the underlying dictionary.

source

pub fn checked_add(&self, other: &Self) -> Result<Self, Error>

Checked extra currency collection addition. Computes self + rhs for each currency, returning Err if overflow occurred or dictionaries had invalid structure.

source

pub fn checked_sub(&self, other: &Self) -> Result<Self, Error>

Checked extra currency subtraction. Computes self - rhs for each currency, returning Err if overflow occurred or dictionaries had invalid structure.

Trait Implementations§

source§

impl Clone for ExtraCurrencyCollection

source§

fn clone(&self) -> ExtraCurrencyCollection

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 ExtraCurrencyCollection

source§

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

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

impl Default for ExtraCurrencyCollection

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for ExtraCurrencyCollection

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl ExactSize for ExtraCurrencyCollection

source§

fn exact_size(&self) -> Size

Exact size of the value when it is stored in a slice.
source§

impl From<Dict<u32, VarUint248>> for ExtraCurrencyCollection

source§

fn from(value: Dict<u32, VarUint248>) -> Self

Converts to this type from the input type.
source§

impl<'tlb> Load<'tlb> for ExtraCurrencyCollection

source§

fn load_from(__slice: &mut CellSlice<'tlb>) -> Result<Self, Error>

Tries to load itself from a cell slice.
source§

impl PartialEq for ExtraCurrencyCollection

source§

fn eq(&self, other: &ExtraCurrencyCollection) -> 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 Serialize for ExtraCurrencyCollection

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Store for ExtraCurrencyCollection

source§

fn store_into( &self, __builder: &mut CellBuilder, __context: &mut dyn CellContext, ) -> Result<(), Error>

Tries to store itself into the cell builder.
source§

impl Eq for ExtraCurrencyCollection

source§

impl StructuralPartialEq for ExtraCurrencyCollection

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§

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> 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

source§

type Output = T

Should always be Self
source§

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

source§

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>,

source§

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>,

source§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> EquivalentRepr<T> for T