pub struct BookConfig {
pub max_orders: u32,
pub grid_len: u32,
pub tick_size: u64,
pub grid_start_tick: u64,
pub default_stp: StpPolicy,
}Expand description
Static configuration for one crate::Book.
Fields§
§max_orders: u32Arena capacity: the maximum number of simultaneously live orders.
At least 1 and at most 2^31 - 2, so slot indices can reserve
u32::MAX as NIL.
grid_len: u32Number of price ticks on the grid. A multiple of 64, at least 64, at most 2^22.
tick_size: u64Quote units per tick, at least 1.
grid_start_tick: u64Tick value of grid index 0. A price whose tick is t maps to grid
index t - grid_start_tick.
default_stp: StpPolicySelf-trade prevention policy applied when a command does not name one (executes from Milestone 2).
Implementations§
Source§impl BookConfig
impl BookConfig
Sourcepub fn grid_end_tick(&self) -> Result<u64, BookError>
pub fn grid_end_tick(&self) -> Result<u64, BookError>
The tick value one past the last tick on the grid.
§Errors
Returns BookError::InvalidConfig if the grid end overflows
u64 (the m9a construction bound, ARCHITECTURE.md section 3.2).
Trait Implementations§
Source§impl Clone for BookConfig
impl Clone for BookConfig
impl Copy for BookConfig
Source§impl Debug for BookConfig
impl Debug for BookConfig
impl Eq for BookConfig
Source§impl PartialEq for BookConfig
impl PartialEq for BookConfig
impl StructuralPartialEq for BookConfig
Auto Trait Implementations§
impl Forget for BookConfig
impl Freeze for BookConfig
impl Move for BookConfig
impl RefUnwindSafe for BookConfig
impl Send for BookConfig
impl Sync for BookConfig
impl Unpin for BookConfig
impl UnsafeUnpin for BookConfig
impl UnwindSafe for BookConfig
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