pub struct PpmFee(/* private fields */);Expand description
A fee with sub-satoshi precision: the undivided numerator of a ppm fee calculation, in millionths of a satoshi.
Produced by Amount * PpmFeeRate. To be usable as money it must be rounded to whole
satoshis with PpmFee::to_amount_ceil; keeping the numerator exact until then lets sums
of fees round once on the total instead of once per term.
Implementations§
Source§impl PpmFee
impl PpmFee
Sourcepub fn to_sat_ceil(self) -> Option<u64>
pub fn to_sat_ceil(self) -> Option<u64>
The fee in satoshis, rounded up to the next whole satoshi.
Returns None if the result exceeds u64::MAX.
Sourcepub fn to_amount_ceil(self) -> Option<Amount>
pub fn to_amount_ceil(self) -> Option<Amount>
The fee rounded up to the next whole satoshi.
Returns None if the result exceeds u64::MAX satoshis.
Sourcepub fn checked_add(self, other: PpmFee) -> Option<PpmFee>
pub fn checked_add(self, other: PpmFee) -> Option<PpmFee>
Returns None if the sum overflows.
Trait Implementations§
impl Copy for PpmFee
impl Eq for PpmFee
Source§impl Ord for PpmFee
impl Ord for PpmFee
1.21.0 (const: unstable) · 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 PartialOrd for PpmFee
impl PartialOrd for PpmFee
impl StructuralPartialEq for PpmFee
Auto Trait Implementations§
impl Freeze for PpmFee
impl RefUnwindSafe for PpmFee
impl Send for PpmFee
impl Sync for PpmFee
impl Unpin for PpmFee
impl UnsafeUnpin for PpmFee
impl UnwindSafe for PpmFee
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