pub struct SimulationModuleHandle(/* private fields */);Expand description
Shared runtime handle for a simulation module.
Clones share the same module instance and state. Create a separate module for each venue or run that requires isolated state.
Implementations§
Source§impl SimulationModuleHandle
impl SimulationModuleHandle
Sourcepub fn new<T>(module: T) -> Selfwhere
T: SimulationModule + 'static,
pub fn new<T>(module: T) -> Selfwhere
T: SimulationModule + 'static,
Creates a new SimulationModuleHandle from a simulation module.
Sourcepub fn from_rc(module: Rc<dyn SimulationModule>) -> Self
pub fn from_rc(module: Rc<dyn SimulationModule>) -> Self
Creates a new SimulationModuleHandle from an existing reference-counted module.
Trait Implementations§
Source§impl Clone for SimulationModuleHandle
impl Clone for SimulationModuleHandle
Source§fn clone(&self) -> SimulationModuleHandle
fn clone(&self) -> SimulationModuleHandle
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 moreSource§impl Debug for SimulationModuleHandle
impl Debug for SimulationModuleHandle
Source§impl From<SimulationModuleAny> for SimulationModuleHandle
impl From<SimulationModuleAny> for SimulationModuleHandle
Source§fn from(module: SimulationModuleAny) -> Self
fn from(module: SimulationModuleAny) -> Self
Converts to this type from the input type.
Source§impl SimulationModule for SimulationModuleHandle
impl SimulationModule for SimulationModuleHandle
Source§fn pre_process(&self, data: &Data) -> Result<()>
fn pre_process(&self, data: &Data) -> Result<()>
Pre-processes market data before matching engine processing. Read more
Source§fn process(
&self,
ts_now: UnixNanos,
ctx: &ExchangeContext<'_>,
) -> Result<SimulationModuleResult>
fn process( &self, ts_now: UnixNanos, ctx: &ExchangeContext<'_>, ) -> Result<SimulationModuleResult>
Processes simulation logic at the given timestamp. Read more
Source§fn acknowledge(&self, outcomes: &[AccountAdjustmentOutcome]) -> Result<()>
fn acknowledge(&self, outcomes: &[AccountAdjustmentOutcome]) -> Result<()>
Acknowledges the ordered application outcomes for a completed batch. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SimulationModuleHandle
impl !Send for SimulationModuleHandle
impl !Sync for SimulationModuleHandle
impl !UnwindSafe for SimulationModuleHandle
impl Freeze for SimulationModuleHandle
impl Unpin for SimulationModuleHandle
impl UnsafeUnpin for SimulationModuleHandle
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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