pub struct Sats(pub u64);
Tuple Fields§
§0: u64
Implementations§
Source§impl Sats
impl Sats
pub const ZERO: Sats
pub const BTC: Sats
pub const fn from_btc(btc: u32) -> Sats
pub fn from_sats(sats: impl Into<u64>) -> Sats
pub const fn is_zero(&self) -> bool
pub const fn is_non_zero(&self) -> bool
pub const fn btc_round(&self) -> u64
pub const fn btc_ceil(&self) -> u64
pub const fn btc_floor(&self) -> u64
pub const fn sats(&self) -> u64
pub fn sats_i64(&self) -> i64
pub const fn sats_rem(&self) -> u64
pub const fn btc_sats(&self) -> (u64, u64)
pub fn checked_add(&self, other: impl Into<Sats>) -> Option<Sats>
pub fn checked_sub(&self, other: impl Into<Sats>) -> Option<Sats>
pub fn checked_add_assign(&mut self, other: impl Into<Sats>) -> Option<Sats>
pub fn checked_sub_assign(&mut self, other: impl Into<Sats>) -> Option<Sats>
pub fn saturating_add(&self, other: impl Into<Sats>) -> Sats
pub fn saturating_sub(&self, other: impl Into<Sats>) -> Sats
pub fn saturating_add_assign(&mut self, other: impl Into<Sats>)
pub fn saturating_sub_assign(&mut self, other: impl Into<Sats>)
Trait Implementations§
Source§impl AddAssign for Sats
impl AddAssign for Sats
Source§fn add_assign(&mut self, rhs: Sats)
fn add_assign(&mut self, rhs: Sats)
Performs the
+=
operation. Read moreSource§impl ConsensusDecode for Sats
impl ConsensusDecode for Sats
fn consensus_decode( reader: &mut impl Read, ) -> Result<Sats, ConsensusDecodeError>
fn consensus_deserialize( bytes: impl AsRef<[u8]>, ) -> Result<Self, ConsensusDecodeError>
Source§impl ConsensusEncode for Sats
impl ConsensusEncode for Sats
Source§impl DivAssign for Sats
impl DivAssign for Sats
Source§fn div_assign(&mut self, rhs: Sats)
fn div_assign(&mut self, rhs: Sats)
Performs the
/=
operation. Read moreSource§impl MulAssign for Sats
impl MulAssign for Sats
Source§fn mul_assign(&mut self, rhs: Sats)
fn mul_assign(&mut self, rhs: Sats)
Performs the
*=
operation. Read moreSource§impl Ord for Sats
impl Ord for Sats
Source§impl PartialOrd for Sats
impl PartialOrd for Sats
Source§impl RemAssign for Sats
impl RemAssign for Sats
Source§fn rem_assign(&mut self, rhs: Sats)
fn rem_assign(&mut self, rhs: Sats)
Performs the
%=
operation. Read moreSource§impl StrictDecode for Sats
impl StrictDecode for Sats
fn strict_decode(reader: &mut impl TypedRead) -> Result<Sats, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for Sats
impl StrictEncode for Sats
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictTuple for Sats
impl StrictTuple for Sats
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Sats
impl StrictType for Sats
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
Source§impl SubAssign for Sats
impl SubAssign for Sats
Source§fn sub_assign(&mut self, rhs: Sats)
fn sub_assign(&mut self, rhs: Sats)
Performs the
-=
operation. Read moreSource§impl Wrapper for Sats
impl Wrapper for Sats
Source§fn from_inner(inner: <Sats as Wrapper>::Inner) -> Sats
fn from_inner(inner: <Sats as Wrapper>::Inner) -> Sats
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &<Sats as Wrapper>::Inner
fn as_inner(&self) -> &<Sats as Wrapper>::Inner
Returns reference to the inner representation for the wrapper type
Source§impl WrapperMut for Sats
impl WrapperMut for Sats
impl Copy for Sats
impl Eq for Sats
impl StrictProduct for Sats
impl StructuralPartialEq for Sats
Auto Trait Implementations§
impl Freeze for Sats
impl RefUnwindSafe for Sats
impl Send for Sats
impl Sync for Sats
impl Unpin for Sats
impl UnwindSafe for Sats
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.