pub struct Sats(pub u64);
Tuple Fields§
§0: u64
Implementations§
Source§impl Sats
impl Sats
pub const ZERO: Self
pub const BTC: Self
pub const fn from_btc(btc: u32) -> Self
pub fn from_sats(sats: impl Into<u64>) -> Self
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<Self>) -> Option<Self>
pub fn checked_sub(&self, other: impl Into<Self>) -> Option<Self>
pub fn checked_add_assign(&mut self, other: impl Into<Self>) -> Option<Self>
pub fn checked_sub_assign(&mut self, other: impl Into<Self>) -> Option<Self>
pub fn saturating_add(&self, other: impl Into<Self>) -> Self
pub fn saturating_sub(&self, other: impl Into<Self>) -> Self
pub fn saturating_add_assign(&mut self, other: impl Into<Self>)
pub fn saturating_sub_assign(&mut self, other: impl Into<Self>)
Trait Implementations§
Source§impl AddAssign for Sats
impl AddAssign for Sats
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl ConsensusDecode for Sats
impl ConsensusDecode for Sats
fn consensus_decode( reader: &mut impl Read, ) -> Result<Self, ConsensusDecodeError>
fn consensus_deserialize( bytes: impl AsRef<[u8]>, ) -> Result<Self, ConsensusDecodeError>
Source§impl ConsensusEncode for Sats
impl ConsensusEncode for Sats
Source§impl<'de> Deserialize<'de> for Sats
impl<'de> Deserialize<'de> for Sats
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 DivAssign for Sats
impl DivAssign for Sats
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moreSource§impl MulAssign for Sats
impl MulAssign for Sats
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
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: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moreSource§impl StrictDecode for Sats
impl StrictDecode for Sats
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictEncode for Sats
impl StrictEncode for Sats
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
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: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreSource§impl Wrapper for Sats
impl Wrapper for Sats
Source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
Source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
Source§impl WrapperMut for Sats
impl WrapperMut for Sats
Source§fn as_inner_mut(&mut self) -> &mut <Self as Wrapper>::Inner
fn as_inner_mut(&mut self) -> &mut <Self as Wrapper>::Inner
Returns a mutable reference to the inner representation for the wrapper
type
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.