#[non_exhaustive]pub struct Order {
pub id: OrderId,
pub request: OrderRequest,
pub status: OrderStatus,
pub filled: f64,
pub fill_price: Option<f64>,
pub placed: Option<DateTime<Utc>>,
pub closed: Option<DateTime<Utc>>,
}Expand description
An order the broker holds. Pushed again on every change; the terminal replaces the order with the same id.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: OrderIdThe broker’s id for the order: an event with the same id replaces it.
request: OrderRequestWhat was asked for.
status: OrderStatusWhere the order stands.
filled: f64The quantity filled so far, from 0 up to the requested quantity.
fill_price: Option<f64>The average price of the filled quantity, when the broker reports it.
placed: Option<DateTime<Utc>>When the order was placed, when the broker reports it.
closed: Option<DateTime<Utc>>When the order filled in full, was cancelled or was rejected, when the broker reports it.
Implementations§
Source§impl Order
impl Order
Sourcepub fn new(id: OrderId, request: OrderRequest, status: OrderStatus) -> Self
pub fn new(id: OrderId, request: OrderRequest, status: OrderStatus) -> Self
An order with nothing filled yet.
Trait Implementations§
impl StructuralPartialEq 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 UnsafeUnpin 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
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,
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 more