pub struct OrderBookBuilder { /* private fields */ }Expand description
Implementations§
Source§impl OrderBookBuilder
impl OrderBookBuilder
Sourcepub fn new(symbol: impl Into<String>) -> Self
pub fn new(symbol: impl Into<String>) -> Self
Creates a new builder instance for the given symbol.
§Parameters
symbol: The market symbol (e.g.,"BTCUSD")
Sourcepub fn with_options(self, options: OrderBookOptions) -> Self
pub fn with_options(self, options: OrderBookOptions) -> Self
Sets all options in bulk via an OrderBookOptions struct.
This method can be used for advanced configuration.
Sourcepub fn with_snapshot(self, snapshot: Snapshot) -> Self
pub fn with_snapshot(self, snapshot: Snapshot) -> Self
Attaches a snapshot to this builder, so that the constructed OrderBook
will be restored to the state captured in the snapshot rather than starting
empty.
§Parameters
snapshot: A previously capturedSnapshotrepresenting the full state of an order book at a given point in time.
§Returns
The builder itself, allowing method chaining.
Sourcepub fn with_replay_logs(self, logs: Vec<JournalLog>) -> Self
pub fn with_replay_logs(self, logs: Vec<JournalLog>) -> Self
Sets a sequence of journal logs to be replayed after snapshot restoration.
This allows the order book to reconstruct its state by first restoring a snapshot (if provided) and then applying all operations contained in the logs.
§Parameters
logs: A vector ofJournalLogentries to replay. Logs should ideally be in chronological order (op_idascending), butreplay_logswill sort them internally.
§Returns
Returns self to allow chaining with other builder methods.
Sourcepub fn with_journaling(self, enabled: bool) -> Self
pub fn with_journaling(self, enabled: bool) -> Self
Auto Trait Implementations§
impl Freeze for OrderBookBuilder
impl RefUnwindSafe for OrderBookBuilder
impl Send for OrderBookBuilder
impl Sync for OrderBookBuilder
impl Unpin for OrderBookBuilder
impl UnwindSafe for OrderBookBuilder
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