pub struct ValidatedBsm { /* private fields */ }Expand description
Validated BSM pack (strictly positive S,K; non-negative T,σ; finite rates).
Engineering: construct once per “clean” snapshot; use on hot paths so validation
is not mixed into every formula line. For mutable live fields prefer
crate::derivatives::BsmState.
Implementations§
Source§impl ValidatedBsm
impl ValidatedBsm
Sourcepub fn new(params: BsmParams) -> FinanceResult<Self>
pub fn new(params: BsmParams) -> FinanceResult<Self>
Fallible constructor — Result-only style (new, not try_new).
§Errors
Non-finite inputs; non-positive spot/strike; negative time or vol.
pub fn params(self) -> BsmParams
Sourcepub fn price(self, option_type: OptionType) -> FinanceResult<f64>
pub fn price(self, option_type: OptionType) -> FinanceResult<f64>
Model price for this validated snapshot.
Sourcepub fn greeks(self, option_type: OptionType) -> FinanceResult<BsmGreeks>
pub fn greeks(self, option_type: OptionType) -> FinanceResult<BsmGreeks>
Model Greeks for this validated snapshot.
Sourcepub fn cross_greeks(
self,
option_type: OptionType,
) -> FinanceResult<BsmCrossGreeks>
pub fn cross_greeks( self, option_type: OptionType, ) -> FinanceResult<BsmCrossGreeks>
Cross Greeks (vanna, volga, charm).
Trait Implementations§
Source§impl Clone for ValidatedBsm
impl Clone for ValidatedBsm
Source§fn clone(&self) -> ValidatedBsm
fn clone(&self) -> ValidatedBsm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ValidatedBsm
Source§impl Debug for ValidatedBsm
impl Debug for ValidatedBsm
Source§impl PartialEq for ValidatedBsm
impl PartialEq for ValidatedBsm
impl StructuralPartialEq for ValidatedBsm
Auto Trait Implementations§
impl Freeze for ValidatedBsm
impl RefUnwindSafe for ValidatedBsm
impl Send for ValidatedBsm
impl Sync for ValidatedBsm
impl Unpin for ValidatedBsm
impl UnsafeUnpin for ValidatedBsm
impl UnwindSafe for ValidatedBsm
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<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