pub struct OrderList {
pub id: OrderListId,
pub instrument_id: InstrumentId,
pub strategy_id: StrategyId,
pub client_order_ids: Vec<ClientOrderId>,
pub ts_init: UnixNanos,
}Expand description
Lightweight identifier container for a group of related orders.
Stores only the order IDs; full order data lives in the cache.
For serialization payload, see SubmitOrderList.order_inits.
All orders should share the same venue. The production constructors
enforce this: OrderList::from_orders and OrderFactory::create_list
panic on mixed venues, and Strategy::submit_order_list bails at the
user-facing entry. OrderList::new is infallible and takes
instrument_id directly; it does not verify the venues of the supplied
client_order_ids. The instrument_id is a representative value taken
from the first order; orders may target different instruments at that
venue. Downstream consumers that need a per-order instrument should
resolve each order from the cache.
Fields§
§id: OrderListId§instrument_id: InstrumentId§strategy_id: StrategyId§client_order_ids: Vec<ClientOrderId>§ts_init: UnixNanosImplementations§
Source§impl OrderList
impl OrderList
Sourcepub fn new(
order_list_id: OrderListId,
instrument_id: InstrumentId,
strategy_id: StrategyId,
client_order_ids: Vec<ClientOrderId>,
ts_init: UnixNanos,
) -> Self
pub fn new( order_list_id: OrderListId, instrument_id: InstrumentId, strategy_id: StrategyId, client_order_ids: Vec<ClientOrderId>, ts_init: UnixNanos, ) -> Self
Creates a new OrderList instance.
Construction is infallible. OrderList::validate checks the
syntactic invariants (non-empty, unique client_order_ids); the
strategy submission path (Strategy::submit_order_list) runs it
before the list reaches the cache.
Sourcepub fn from_orders(orders: &[OrderAny], ts_init: UnixNanos) -> Self
pub fn from_orders(orders: &[OrderAny], ts_init: UnixNanos) -> Self
Creates a new OrderList from a slice of orders.
Derives order_list_id, instrument_id, and strategy_id from the
first order. The instrument_id is representative only; orders in
the list may target different instruments at the same venue.
Callers in the production path (OrderFactory plus a single
strategy instance) produce orders with a consistent order_list_id
and strategy_id. OrderList::validate checks the syntactic
invariants (non-empty, unique client_order_ids); it does not
check cross-field consistency.
§Panics
Panics if orders is empty, if the first order has no
order_list_id, or if orders span more than one venue. Callers
are expected to guard non-empty input; Strategy::submit_order_list
filters out the empty case and bails on mixed venues before
reaching this constructor.
Sourcepub fn validate(&self) -> Result<(), OrderListValidationError>
pub fn validate(&self) -> Result<(), OrderListValidationError>
pub fn first(&self) -> Option<&ClientOrderId>
Trait Implementations§
impl DerefToPyAny for OrderList
Source§impl<'de> Deserialize<'de> for OrderList
impl<'de> Deserialize<'de> for OrderList
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for OrderList
Source§impl<'py> IntoPyObject<'py> for OrderList
impl<'py> IntoPyObject<'py> for OrderList
Source§impl PyClassImpl for OrderList
impl PyClassImpl for OrderList
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Lightweight identifier container for a group of related orders.
///
/// Stores only the order IDs; full order data lives in the cache.
/// For serialization payload, see `SubmitOrderList.order_inits`.
///
/// All orders should share the same venue. The production constructors
/// enforce this: [`OrderList::from_orders`] and `OrderFactory::create_list`
/// panic on mixed venues, and `Strategy::submit_order_list` bails at the
/// user-facing entry. [`OrderList::new`] is infallible and takes
/// `instrument_id` directly; it does not verify the venues of the supplied
/// `client_order_ids`. The `instrument_id` is a representative value taken
/// from the first order; orders may target different instruments at that
/// venue. Downstream consumers that need a per-order instrument should
/// resolve each order from the cache.
const RAW_DOC: &'static CStr = /// Lightweight identifier container for a group of related orders. /// /// Stores only the order IDs; full order data lives in the cache. /// For serialization payload, see `SubmitOrderList.order_inits`. /// /// All orders should share the same venue. The production constructors /// enforce this: [`OrderList::from_orders`] and `OrderFactory::create_list` /// panic on mixed venues, and `Strategy::submit_order_list` bails at the /// user-facing entry. [`OrderList::new`] is infallible and takes /// `instrument_id` directly; it does not verify the venues of the supplied /// `client_order_ids`. The `instrument_id` is a representative value taken /// from the first order; orders may target different instruments at that /// venue. Downstream consumers that need a per-order instrument should /// resolve each order from the cache.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<OrderList as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<OrderList>
type Layout = <<OrderList as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<OrderList>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForOrderList
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyTypeInfo for OrderList
impl PyTypeInfo for OrderList
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.Auto Trait Implementations§
impl Freeze for OrderList
impl RefUnwindSafe for OrderList
impl Send for OrderList
impl Sync for OrderList
impl Unpin for OrderList
impl UnsafeUnpin for OrderList
impl UnwindSafe for OrderList
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
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
impl<'py, T> FromPyObjectOwned<'py> for Twhere
T: for<'a> FromPyObject<'a, 'py>,
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more