pub struct Sats(/* private fields */);Expand description
Satoshis
Implementations§
Source§impl Sats
impl Sats
pub const ZERO: Self
pub const _1: Self
pub const _10: Self
pub const _100: Self
pub const _1K: Self
pub const _10K: Self
pub const _100K: Self
pub const _1M: Self
pub const _10M: Self
pub const _1BTC: Self = Self::ONE_BTC
pub const _10BTC: Self
pub const _100BTC: Self
pub const _1K_BTC: Self
pub const _10K_BTC: Self
pub const _100K_BTC: Self
pub const ONE_BTC: Self
pub const MAX: Self
pub const COINBASE: Self
pub const FIFTY_BTC: Self
pub const ONE_BTC_U128: u128 = 100_000_000u128
pub fn new(sats: u64) -> Self
pub fn is_zero(&self) -> bool
pub fn is_not_zero(&self) -> bool
pub fn is_max(&self) -> bool
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 Bytes for Sats
impl Bytes for Sats
Source§impl CheckedSub<usize> for Sats
impl CheckedSub<usize> for Sats
fn checked_sub(self, rhs: usize) -> Option<Self>
Source§impl CheckedSub for Sats
impl CheckedSub for Sats
fn checked_sub(self, rhs: Self) -> Option<Self>
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 Formattable for Sats
impl Formattable for Sats
Source§impl JsonSchema for Sats
impl JsonSchema for Sats
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 inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Sats
impl Ord for Sats
Source§impl PartialOrd for Sats
impl PartialOrd for Sats
Source§impl Pco for Sats
impl Pco for Sats
type NumberType = <u64 as Pco>::NumberType
Source§impl SaturatingAdd for Sats
impl SaturatingAdd for Sats
fn saturating_add(self, rhs: Self) -> Self
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 moreimpl Copy for Sats
impl Eq for Sats
impl StructuralPartialEq for Sats
impl TransparentPco<<u64 as Pco>::NumberType> 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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FromInnerSlice<<T as Pco>::NumberType> for Twhere
T: PcoVecValue,
impl<T> FromInnerSlice<<T as Pco>::NumberType> for Twhere
T: PcoVecValue,
const _SIZE_CHECK: ()
const _ALIGN_CHECK: ()
fn from_inner_slice(vec: Vec<<T as Pco>::NumberType>) -> Vec<T>
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