pub struct RiskEngine {
pub throttled_submit_order: Throttler<SubmitOrder, Box<dyn Fn(SubmitOrder)>>,
pub throttled_modify_order: Throttler<ModifyOrder, Box<dyn Fn(ModifyOrder)>>,
/* private fields */
}
Fields§
§throttled_submit_order: Throttler<SubmitOrder, Box<dyn Fn(SubmitOrder)>>
§throttled_modify_order: Throttler<ModifyOrder, Box<dyn Fn(ModifyOrder)>>
Implementations§
Source§impl RiskEngine
impl RiskEngine
pub fn new( config: RiskEngineConfig, clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>, msgbus: Rc<RefCell<MessageBus>>, ) -> Self
pub fn execute(&mut self, command: TradingCommand)
pub fn process(&mut self, event: OrderEventAny)
pub fn set_trading_state(&mut self, state: TradingState)
pub fn set_max_notional_per_order( &mut self, instrument_id: InstrumentId, new_value: Decimal, )
Auto Trait Implementations§
impl Freeze for RiskEngine
impl !RefUnwindSafe for RiskEngine
impl !Send for RiskEngine
impl !Sync for RiskEngine
impl Unpin for RiskEngine
impl !UnwindSafe for RiskEngine
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
§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>
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