Struct cw_utils::NativeBalance
source · Tuple Fields§
§0: Vec<Coin>Implementations§
source§impl NativeBalance
impl NativeBalance
pub fn into_vec(self) -> Vec<Coin>
sourcepub fn has(&self, required: &Coin) -> bool
pub fn has(&self, required: &Coin) -> bool
returns true if the list of coins has at least the required amount
sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
normalize Wallet (sorted by denom, no 0 elements, no duplicate denoms)
pub fn is_empty(&self) -> bool
sourcepub fn sub_saturating(self, other: Coin) -> StdResult<Self>
pub fn sub_saturating(self, other: Coin) -> StdResult<Self>
similar to Balance.sub, but doesn’t fail when minuend less than subtrahend
Trait Implementations§
source§impl Add<Coin> for NativeBalance
impl Add<Coin> for NativeBalance
source§impl Add<NativeBalance> for NativeBalance
impl Add<NativeBalance> for NativeBalance
§type Output = NativeBalance
type Output = NativeBalance
The resulting type after applying the
+ operator.source§fn add(self, other: NativeBalance) -> Self
fn add(self, other: NativeBalance) -> Self
Performs the
+ operation. Read moresource§impl AddAssign<Coin> for NativeBalance
impl AddAssign<Coin> for NativeBalance
source§fn add_assign(&mut self, other: Coin)
fn add_assign(&mut self, other: Coin)
Performs the
+= operation. Read moresource§impl AddAssign<NativeBalance> for NativeBalance
impl AddAssign<NativeBalance> for NativeBalance
source§fn add_assign(&mut self, other: NativeBalance)
fn add_assign(&mut self, other: NativeBalance)
Performs the
+= operation. Read moresource§impl Clone for NativeBalance
impl Clone for NativeBalance
source§fn clone(&self) -> NativeBalance
fn clone(&self) -> NativeBalance
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 NativeBalance
impl Debug for NativeBalance
source§impl Default for NativeBalance
impl Default for NativeBalance
source§fn default() -> NativeBalance
fn default() -> NativeBalance
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for NativeBalance
impl<'de> Deserialize<'de> for NativeBalance
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Display for NativeBalance
impl Display for NativeBalance
source§impl JsonSchema for NativeBalance
impl JsonSchema for NativeBalance
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read more