pub struct UsdAmount { /* private fields */ }Implementations§
Source§impl UsdAmount
impl UsdAmount
pub const ZERO: Self
pub fn from_femto_usd(femto_usd: i128) -> Self
pub fn from_decimal_str(value: &str) -> Option<Self>
pub fn femto_usd(self) -> i128
pub fn is_zero(self) -> bool
pub fn checked_div_u64(self, divisor: u64) -> Option<Self>
pub fn saturating_add(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
pub fn cost_for_tokens_per_million(tokens: i64, price_per_million: Self) -> Self
pub fn format_usd(self) -> String
Trait Implementations§
Source§impl Ord for UsdAmount
impl Ord for UsdAmount
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 UsdAmount
impl PartialOrd for UsdAmount
impl Copy for UsdAmount
impl Eq for UsdAmount
impl StructuralPartialEq for UsdAmount
Auto Trait Implementations§
impl Freeze for UsdAmount
impl RefUnwindSafe for UsdAmount
impl Send for UsdAmount
impl Sync for UsdAmount
impl Unpin for UsdAmount
impl UnsafeUnpin for UsdAmount
impl UnwindSafe for UsdAmount
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.