pub struct BitcoinAmount(pub i64);Expand description
Represents the amount of Bitcoin in satoshis
Tuple Fields§
§0: i64Implementations§
Source§impl BitcoinAmount
impl BitcoinAmount
Sourcepub const ZERO: BitcoinAmount
pub const ZERO: BitcoinAmount
The zero amount.
Sourcepub const ONE_SAT: BitcoinAmount
pub const ONE_SAT: BitcoinAmount
Exactly one satoshi.
Sourcepub const ONE_BTC: BitcoinAmount
pub const ONE_BTC: BitcoinAmount
Exactly one bitcoin.
pub fn from_satoshi(satoshis: i64) -> Result<Self, AmountError>
pub fn from_ubtc(ubtc_value: i64) -> Result<Self, AmountError>
pub fn from_mbtc(mbtc_value: i64) -> Result<Self, AmountError>
pub fn from_cbtc(cbtc_value: i64) -> Result<Self, AmountError>
pub fn from_dbtc(dbtc_value: i64) -> Result<Self, AmountError>
pub fn from_btc(btc_value: i64) -> Result<Self, AmountError>
Trait Implementations§
Source§impl Add for BitcoinAmount
impl Add for BitcoinAmount
Source§impl Clone for BitcoinAmount
impl Clone for BitcoinAmount
Source§fn clone(&self) -> BitcoinAmount
fn clone(&self) -> BitcoinAmount
Returns a duplicate 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 BitcoinAmount
impl Debug for BitcoinAmount
Source§impl Display for BitcoinAmount
impl Display for BitcoinAmount
Source§impl Hash for BitcoinAmount
impl Hash for BitcoinAmount
Source§impl Ord for BitcoinAmount
impl Ord for BitcoinAmount
Source§fn cmp(&self, other: &BitcoinAmount) -> Ordering
fn cmp(&self, other: &BitcoinAmount) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BitcoinAmount
impl PartialEq for BitcoinAmount
Source§impl PartialOrd for BitcoinAmount
impl PartialOrd for BitcoinAmount
Source§impl Serialize for BitcoinAmount
impl Serialize for BitcoinAmount
Source§impl Sub for BitcoinAmount
impl Sub for BitcoinAmount
impl Amount for BitcoinAmount
impl Copy for BitcoinAmount
impl Eq for BitcoinAmount
impl StructuralPartialEq for BitcoinAmount
Auto Trait Implementations§
impl Freeze for BitcoinAmount
impl RefUnwindSafe for BitcoinAmount
impl Send for BitcoinAmount
impl Sync for BitcoinAmount
impl Unpin for BitcoinAmount
impl UnwindSafe for BitcoinAmount
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