pub struct ProbabilisticFillState { /* private fields */ }Implementations§
Source§impl ProbabilisticFillState
impl ProbabilisticFillState
Sourcepub fn new(
prob_fill_on_limit: f64,
prob_slippage: f64,
random_seed: Option<u64>,
) -> Result<Self>
pub fn new( prob_fill_on_limit: f64, prob_slippage: f64, random_seed: Option<u64>, ) -> Result<Self>
Creates a new ProbabilisticFillState instance.
§Errors
Returns an error if probability parameters are not in range [0, 1].
§Panics
Panics if the range check assertions fail.
pub fn is_limit_filled(&mut self) -> bool
pub fn is_slipped(&mut self) -> bool
pub fn random_bool(&mut self, probability: f64) -> bool
Trait Implementations§
Source§impl Clone for ProbabilisticFillState
impl Clone for ProbabilisticFillState
Auto Trait Implementations§
impl Freeze for ProbabilisticFillState
impl RefUnwindSafe for ProbabilisticFillState
impl Send for ProbabilisticFillState
impl Sync for ProbabilisticFillState
impl Unpin for ProbabilisticFillState
impl UnsafeUnpin for ProbabilisticFillState
impl UnwindSafe for ProbabilisticFillState
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,
§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