pub struct SyntheticInstrument_API(/* private fields */);Expand description
C compatible Foreign Function Interface (FFI) for an underlying
SyntheticInstrument.
This struct wraps SyntheticInstrument in a way that makes it compatible with C function
calls, enabling interaction with SyntheticInstrument in a C environment.
It implements the Deref trait, allowing instances of SyntheticInstrument_API to be
dereferenced to SyntheticInstrument, providing access to SyntheticInstruments’s methods without
having to manually access the underlying instance.
Methods from Deref<Target = SyntheticInstrument>§
pub fn is_valid_formula(&self, formula: &str) -> bool
Sourcepub fn change_formula(&mut self, formula: String) -> Result<()>
pub fn change_formula(&mut self, formula: String) -> Result<()>
§Errors
Returns an error if parsing the new formula fails.
Sourcepub fn calculate_from_map(
&mut self,
inputs: &HashMap<String, f64>,
) -> Result<Price>
pub fn calculate_from_map( &mut self, inputs: &HashMap<String, f64>, ) -> Result<Price>
Calculates the price of the synthetic instrument based on component input prices provided as a map.
§Errors
Returns an error if formula evaluation fails, a required component price is missing from the input map, or if setting the value in the evaluation context fails.
Trait Implementations§
Source§impl Debug for SyntheticInstrument_API
impl Debug for SyntheticInstrument_API
Source§impl Deref for SyntheticInstrument_API
impl Deref for SyntheticInstrument_API
Auto Trait Implementations§
impl Freeze for SyntheticInstrument_API
impl !RefUnwindSafe for SyntheticInstrument_API
impl Send for SyntheticInstrument_API
impl Sync for SyntheticInstrument_API
impl Unpin for SyntheticInstrument_API
impl !UnwindSafe for SyntheticInstrument_API
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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