multiversx_chain_vm::world_mock

Struct AccountEsdt

Source
pub struct AccountEsdt(/* private fields */);

Implementations§

Source§

impl AccountEsdt

Source

pub fn is_empty(&self) -> bool

Source

pub fn get_by_identifier(&self, identifier: &[u8]) -> Option<&EsdtData>

Source

pub fn get_roles(&self, identifier: &[u8]) -> Vec<Vec<u8>>

Will provide a clone.

Source

pub fn set_roles(&mut self, token_identifier: Vec<u8>, roles: Vec<Vec<u8>>)

Source

pub fn get_by_identifier_or_default(&self, identifier: &[u8]) -> EsdtData

Will provide a clone.

Source

pub fn get_mut_by_identifier( &mut self, identifier: &[u8], ) -> Option<&mut EsdtData>

Source

pub fn new_from_raw_map(hash: HashMap<Vec<u8>, EsdtData>) -> Self

Source

pub fn increase_balance( &mut self, token_identifier: Vec<u8>, nonce: u64, value: &BigUint, metadata: EsdtInstanceMetadata, )

Source

pub fn set_esdt_balance( &mut self, token_identifier: Vec<u8>, nonce: u64, value: &BigUint, metadata: EsdtInstanceMetadata, )

Source

pub fn get_esdt_balance(&self, token_identifier: &[u8], nonce: u64) -> BigUint

Source

pub fn add_uris( &mut self, token_identifier: &[u8], nonce: u64, new_uris: Vec<Vec<u8>>, )

Source

pub fn update_attributes( &mut self, token_identifier: &[u8], nonce: u64, new_attribute_bytes: Vec<u8>, )

Source

pub fn iter(&self) -> Iter<'_, Vec<u8>, EsdtData>

Source

pub fn set_special_role(&mut self, token_identifier: &[u8], role: &[u8])

Source

pub fn register_and_set_roles( &mut self, token_identifier: &[u8], token_type: VMTokenType, )

Trait Implementations§

Source§

impl Clone for AccountEsdt

Source§

fn clone(&self) -> AccountEsdt

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 AccountEsdt

Source§

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

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

impl Default for AccountEsdt

Source§

fn default() -> AccountEsdt

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

impl Display for AccountEsdt

Source§

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

Formats the value using the given formatter. Read more

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

🔬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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.