pub struct StaticLatencyModel { /* private fields */ }Expand description
Static latency model with fixed latency values.
Models the latency for different order operations including base network latency and specific operation latencies for insert, update, and delete operations.
The base latency is automatically added to each operation latency, matching
Python’s behavior. For example, if base_latency_nanos = 100ms and
insert_latency_nanos = 200ms, the effective insert latency will be 300ms.
Implementations§
Source§impl StaticLatencyModel
impl StaticLatencyModel
Sourcepub fn new(
base_latency_nanos: UnixNanos,
insert_latency_nanos: UnixNanos,
update_latency_nanos: UnixNanos,
delete_latency_nanos: UnixNanos,
) -> Self
pub fn new( base_latency_nanos: UnixNanos, insert_latency_nanos: UnixNanos, update_latency_nanos: UnixNanos, delete_latency_nanos: UnixNanos, ) -> Self
Creates a new StaticLatencyModel instance.
The base latency is added to each operation latency to get the effective latency.
§Arguments
base_latency_nanos- Base network latency added to all operationsinsert_latency_nanos- Additional latency for order insertionupdate_latency_nanos- Additional latency for order updatesdelete_latency_nanos- Additional latency for order cancellation
Trait Implementations§
Source§impl Clone for StaticLatencyModel
impl Clone for StaticLatencyModel
Source§fn clone(&self) -> StaticLatencyModel
fn clone(&self) -> StaticLatencyModel
Returns a duplicate of the value. Read more
1.0.0 · 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 StaticLatencyModel
impl Debug for StaticLatencyModel
Source§impl Display for StaticLatencyModel
impl Display for StaticLatencyModel
Source§impl LatencyModel for StaticLatencyModel
impl LatencyModel for StaticLatencyModel
Source§fn get_insert_latency(&self) -> UnixNanos
fn get_insert_latency(&self) -> UnixNanos
Returns the latency for order insertion operations.
Source§fn get_update_latency(&self) -> UnixNanos
fn get_update_latency(&self) -> UnixNanos
Returns the latency for order update/modify operations.
Source§fn get_delete_latency(&self) -> UnixNanos
fn get_delete_latency(&self) -> UnixNanos
Returns the latency for order delete/cancel operations.
Source§fn get_base_latency(&self) -> UnixNanos
fn get_base_latency(&self) -> UnixNanos
Returns the base latency component.
Auto Trait Implementations§
impl Freeze for StaticLatencyModel
impl RefUnwindSafe for StaticLatencyModel
impl Send for StaticLatencyModel
impl Sync for StaticLatencyModel
impl Unpin for StaticLatencyModel
impl UnwindSafe for StaticLatencyModel
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,
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