pub struct Price(/* private fields */);Expand description
A non-negative price in fixed-point (SCALE = 1e12), bounded to the
certified pricing domain [0, 100_000] real units.
Spot, strike, barrier, and observed option prices are all Prices.
Implementations§
Source§impl Price
impl Price
Sourcepub const MAX: u128
pub const MAX: u128
Upper bound: 100_000 real units (1e17 raw). This is the price bound
the implied-volatility kernel is proven safe against, and it also keeps
the Black-Scholes Greek combinations well within i128.
Sourcepub const fn new(raw: u128) -> Result<Self, SolMathError>
pub const fn new(raw: u128) -> Result<Self, SolMathError>
Construct a validated price. Rejects values above Price::MAX.
Trait Implementations§
impl Copy for Price
impl Eq for Price
Source§impl Ord for Price
impl Ord for Price
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 Price
impl PartialOrd for Price
impl StructuralPartialEq for Price
Auto Trait Implementations§
impl Freeze for Price
impl RefUnwindSafe for Price
impl Send for Price
impl Sync for Price
impl Unpin for Price
impl UnsafeUnpin for Price
impl UnwindSafe for Price
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