pub struct Order {
pub id: u64,
pub symbol_id: u32,
pub order_type: OrderType,
pub order_side: OrderSide,
pub price: f64,
pub stop_price: f64,
pub quantity: u64,
pub executed_quantity: u64,
pub leaves_quantity: u64,
pub time_in_force: OrderTimeInForce,
pub timestamp: OffsetDateTime,
}Expand description
Order struct containing parameters for a given order in the LOB.
Fields§
§id: u64Order Identifier
symbol_id: u32Symbol Identifier
order_type: OrderTypeOrder type (limit, market, etc.)
order_side: OrderSideOrder side (bid or ask)
price: f64Order price
stop_price: f64Order stop price
quantity: u64Order quantity
executed_quantity: u64Order executed quantity
leaves_quantity: u64Order leaves quantity
time_in_force: OrderTimeInForceTime in Force (GTC, IOC, etc.)
timestamp: OffsetDateTimeOrder timestamp
Implementations§
Source§impl Order
impl Order
Sourcepub fn validate(&self)
pub fn validate(&self)
Validate the Order.
This should do the following: - Check the ID is positive. - Check the quantity is valid. - Check the type and validate.
Sourcepub fn order_type(&self) -> &OrderType
pub fn order_type(&self) -> &OrderType
Get the Order type.
Sourcepub fn order_side(&self) -> &OrderSide
pub fn order_side(&self) -> &OrderSide
Get the Order side.
Sourcepub fn stop_price(&self) -> f64
pub fn stop_price(&self) -> f64
Get the Order stop price.
Sourcepub fn executed_quantity(&self) -> u64
pub fn executed_quantity(&self) -> u64
Get the Order executed quantity.
Sourcepub fn leaves_quantity(&self) -> u64
pub fn leaves_quantity(&self) -> u64
Get the Order leaves quantity.
Sourcepub fn time_in_force(&self) -> &OrderTimeInForce
pub fn time_in_force(&self) -> &OrderTimeInForce
Get the Order time in force.
Sourcepub fn timestamp(&self) -> OffsetDateTime
pub fn timestamp(&self) -> OffsetDateTime
Get the Order timestamp.
Trait Implementations§
impl Copy for Order
Auto Trait Implementations§
impl Freeze for Order
impl RefUnwindSafe for Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl UnwindSafe for Order
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.