#[repr(C)]pub struct OrderFactory { /* private fields */ }
Implementations§
Source§impl OrderFactory
impl OrderFactory
Sourcepub fn new(
trader_id: TraderId,
strategy_id: StrategyId,
init_order_id_count: Option<usize>,
init_order_list_id_count: Option<usize>,
clock: &'static AtomicTime,
) -> Self
pub fn new( trader_id: TraderId, strategy_id: StrategyId, init_order_id_count: Option<usize>, init_order_list_id_count: Option<usize>, clock: &'static AtomicTime, ) -> Self
Creates a new OrderFactory
instance.
Sourcepub const fn set_client_order_id_count(&mut self, count: usize)
pub const fn set_client_order_id_count(&mut self, count: usize)
Sets the client order ID generator count.
Sourcepub const fn set_order_list_id_count(&mut self, count: usize)
pub const fn set_order_list_id_count(&mut self, count: usize)
Sets the order list ID generator count.
Sourcepub fn generate_client_order_id(&mut self) -> ClientOrderId
pub fn generate_client_order_id(&mut self) -> ClientOrderId
Generates a new client order ID.
Sourcepub fn generate_order_list_id(&mut self) -> OrderListId
pub fn generate_order_list_id(&mut self) -> OrderListId
Generates a new order list ID.
Sourcepub const fn reset_factory(&mut self)
pub const fn reset_factory(&mut self)
Resets the factory by resetting all ID generators.
Sourcepub fn market(
&mut self,
instrument_id: InstrumentId,
order_side: OrderSide,
quantity: Quantity,
time_in_force: Option<TimeInForce>,
reduce_only: Option<bool>,
quote_quantity: Option<bool>,
exec_algorithm_id: Option<ExecAlgorithmId>,
exec_algorithm_params: Option<IndexMap<Ustr, Ustr>>,
tags: Option<Vec<Ustr>>,
client_order_id: Option<ClientOrderId>,
) -> OrderAny
pub fn market( &mut self, instrument_id: InstrumentId, order_side: OrderSide, quantity: Quantity, time_in_force: Option<TimeInForce>, reduce_only: Option<bool>, quote_quantity: Option<bool>, exec_algorithm_id: Option<ExecAlgorithmId>, exec_algorithm_params: Option<IndexMap<Ustr, Ustr>>, tags: Option<Vec<Ustr>>, client_order_id: Option<ClientOrderId>, ) -> OrderAny
Creates a new market order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OrderFactory
impl RefUnwindSafe for OrderFactory
impl Send for OrderFactory
impl Sync for OrderFactory
impl Unpin for OrderFactory
impl UnwindSafe for OrderFactory
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