pub struct Prices { /* private fields */ }Expand description
USD prices for one range, derived from the range’s own reroutes.
Implementations§
Source§impl Prices
impl Prices
pub const fn sol_usd(&self) -> f64
Sourcepub fn usd(&self, mint: &Address, raw: f64) -> Option<f64>
pub fn usd(&self, mint: &Address, raw: f64) -> Option<f64>
The USD value of raw base units of mint. None when the range could not price the
mint, which the report counts rather than folding in as zero.
Linear in raw on every path, so a caller may sum one mint’s raw amounts and convert the
total once, or pass an amount a weight has already scaled out of whole units.
Auto Trait Implementations§
impl Forget for Prices
impl Freeze for Prices
impl Move for Prices
impl RefUnwindSafe for Prices
impl Send for Prices
impl Sync for Prices
impl Unpin for Prices
impl UnsafeUnpin for Prices
impl UnwindSafe for Prices
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