pub trait FeeModel {
// Required method
fn get_commission(
&self,
order: &OrderAny,
fill_quantity: Quantity,
fill_px: Price,
instrument: &InstrumentAny,
) -> Result<Money>;
// Provided method
fn get_commission_with_context(
&self,
order: &OrderAny,
fill_quantity: Quantity,
fill_px: Price,
instrument: &InstrumentAny,
_underlying_px: Option<Price>,
) -> Result<Money> { ... }
}Required Methods§
Sourcefn get_commission(
&self,
order: &OrderAny,
fill_quantity: Quantity,
fill_px: Price,
instrument: &InstrumentAny,
) -> Result<Money>
fn get_commission( &self, order: &OrderAny, fill_quantity: Quantity, fill_px: Price, instrument: &InstrumentAny, ) -> Result<Money>
Provided Methods§
Sourcefn get_commission_with_context(
&self,
order: &OrderAny,
fill_quantity: Quantity,
fill_px: Price,
instrument: &InstrumentAny,
_underlying_px: Option<Price>,
) -> Result<Money>
fn get_commission_with_context( &self, order: &OrderAny, fill_quantity: Quantity, fill_px: Price, instrument: &InstrumentAny, _underlying_px: Option<Price>, ) -> Result<Money>
Calculates commission for a fill with additional pricing context.
§Errors
Returns an error if commission calculation fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".