pub struct TieredTickScheme { /* private fields */ }Expand description
Tick scheme with price-dependent tick sizes.
Stores expanded ticks as raw fixed-point integers for exact comparison and fast binary search. Each tier defines a (start, stop, step) range that is expanded at construction.
Implementations§
Source§impl TieredTickScheme
impl TieredTickScheme
Sourcepub fn new(
tiers: &[(f64, f64, f64)],
price_precision: u8,
max_ticks_per_tier: usize,
) -> Result<Self>
pub fn new( tiers: &[(f64, f64, f64)], price_precision: u8, max_ticks_per_tier: usize, ) -> Result<Self>
Creates a new TieredTickScheme from tier definitions.
Each tier is (start, stop, step) where start < stop and step > 0.
Use f64::INFINITY for the last tier’s stop value.
§Errors
Returns an error if any tier is invalid or contains out-of-range values.
Sourcepub fn tick_count(&self) -> usize
pub fn tick_count(&self) -> usize
Returns the number of ticks.
Trait Implementations§
Source§impl Clone for TieredTickScheme
impl Clone for TieredTickScheme
Source§fn clone(&self) -> TieredTickScheme
fn clone(&self) -> TieredTickScheme
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 TieredTickScheme
impl Debug for TieredTickScheme
Source§impl Display for TieredTickScheme
impl Display for TieredTickScheme
Source§impl PartialEq for TieredTickScheme
impl PartialEq for TieredTickScheme
Source§impl TickSchemeRule for TieredTickScheme
impl TickSchemeRule for TieredTickScheme
impl Eq for TieredTickScheme
Auto Trait Implementations§
impl Freeze for TieredTickScheme
impl RefUnwindSafe for TieredTickScheme
impl Send for TieredTickScheme
impl Sync for TieredTickScheme
impl Unpin for TieredTickScheme
impl UnsafeUnpin for TieredTickScheme
impl UnwindSafe for TieredTickScheme
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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