pub struct NativeBalance(pub Vec<Coin>);
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 for NativeBalance
impl Add for NativeBalance
Source§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 for NativeBalance
impl AddAssign 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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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 schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &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 moreSource§impl PartialEq for NativeBalance
impl PartialEq for NativeBalance
Source§impl Schemaifier for NativeBalance
impl Schemaifier for NativeBalance
fn visit_schema(visitor: &mut SchemaVisitor) -> DefinitionReference
fn id() -> Identifier
Source§impl Serialize for NativeBalance
impl Serialize for NativeBalance
Source§impl Sub<Coin> for NativeBalance
impl Sub<Coin> for NativeBalance
impl StructuralPartialEq for NativeBalance
Auto Trait Implementations§
impl Freeze for NativeBalance
impl RefUnwindSafe for NativeBalance
impl Send for NativeBalance
impl Sync for NativeBalance
impl Unpin for NativeBalance
impl UnwindSafe for NativeBalance
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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