Struct bitcoin_amount::Amount [−][src]
pub struct Amount(_);
A bitcoin amount integer type.
Methods
impl Amount
[src]
impl Amount
pub fn from_btc<T>(btc: T) -> Amount where
T: IntoBtc,
[src]
pub fn from_btc<T>(btc: T) -> Amount where
T: IntoBtc,
Creates an Amount
from the given type.
pub fn from_sat(sat: i64) -> Amount
[src]
pub fn from_sat(sat: i64) -> Amount
Creates a new Amount
from a satoshi amount.
pub fn zero() -> Amount
[src]
pub fn zero() -> Amount
Returns the additive identity of Amount
.
pub fn one() -> Amount
[src]
pub fn one() -> Amount
Returns the multiplicative identity of Amount
.
pub fn max_value() -> Amount
[src]
pub fn max_value() -> Amount
Maximum value that can fit in an Amount
.
pub fn min_value() -> Amount
[src]
pub fn min_value() -> Amount
Minimum value that can fit in an Amount
.
pub fn into_inner(self) -> i64
[src]
pub fn into_inner(self) -> i64
Converts this Amount
to the inner satoshis.
Trait Implementations
impl Debug for Amount
[src]
impl Debug for Amount
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Amount
[src]
impl Clone for Amount
fn clone(&self) -> Amount
[src]
fn clone(&self) -> Amount
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Amount
[src]
impl Copy for Amount
impl Eq for Amount
[src]
impl Eq for Amount
impl PartialEq for Amount
[src]
impl PartialEq for Amount
fn eq(&self, other: &Amount) -> bool
[src]
fn eq(&self, other: &Amount) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Amount) -> bool
[src]
fn ne(&self, other: &Amount) -> bool
This method tests for !=
.
impl Ord for Amount
[src]
impl Ord for Amount
fn cmp(&self, other: &Amount) -> Ordering
[src]
fn cmp(&self, other: &Amount) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialOrd for Amount
[src]
impl PartialOrd for Amount
fn partial_cmp(&self, other: &Amount) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Amount) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Amount) -> bool
[src]
fn lt(&self, other: &Amount) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Amount) -> bool
[src]
fn le(&self, other: &Amount) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Amount) -> bool
[src]
fn gt(&self, other: &Amount) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Amount) -> bool
[src]
fn ge(&self, other: &Amount) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Add for Amount
[src]
impl Add for Amount
type Output = Amount
The resulting type after applying the +
operator.
fn add(self, rhs: Amount) -> Self::Output
[src]
fn add(self, rhs: Amount) -> Self::Output
Performs the +
operation.
impl Div for Amount
[src]
impl Div for Amount
type Output = Amount
The resulting type after applying the /
operator.
fn div(self, rhs: Amount) -> Self::Output
[src]
fn div(self, rhs: Amount) -> Self::Output
Performs the /
operation.
impl Mul for Amount
[src]
impl Mul for Amount
type Output = Amount
The resulting type after applying the *
operator.
fn mul(self, rhs: Amount) -> Self::Output
[src]
fn mul(self, rhs: Amount) -> Self::Output
Performs the *
operation.
impl Sub for Amount
[src]
impl Sub for Amount
type Output = Amount
The resulting type after applying the -
operator.
fn sub(self, rhs: Amount) -> Self::Output
[src]
fn sub(self, rhs: Amount) -> Self::Output
Performs the -
operation.
impl FromStr for Amount
[src]
impl FromStr for Amount