pub struct LimitOrder { /* private fields */ }Expand description
Generic limit order with various configuration options
Implementations§
Source§impl LimitOrder
impl LimitOrder
Sourcepub fn validate(&self) -> Result<(), CommandError>
pub fn validate(&self) -> Result<(), CommandError>
Validate the order specification
Source§impl LimitOrder
impl LimitOrder
Sourcepub fn new(
price: Price,
quantity_policy: QuantityPolicy,
flags: OrderFlags,
) -> Self
pub fn new( price: Price, quantity_policy: QuantityPolicy, flags: OrderFlags, ) -> Self
Create a new limit order
Sourcepub fn quantity_policy(&self) -> QuantityPolicy
pub fn quantity_policy(&self) -> QuantityPolicy
Get the quantity policy
Sourcepub fn visible_quantity(&self) -> Quantity
pub fn visible_quantity(&self) -> Quantity
Get the visible quantity
Get the hidden quantity
Sourcepub fn replenish_quantity(&self) -> Quantity
pub fn replenish_quantity(&self) -> Quantity
Get the replenish quantity
Sourcepub fn total_quantity(&self) -> Quantity
pub fn total_quantity(&self) -> Quantity
Get the total quantity of the order
Sourcepub fn flags(&self) -> &OrderFlags
pub fn flags(&self) -> &OrderFlags
Get the flags of the order
Methods from Deref<Target = OrderFlags>§
Sourcepub fn time_in_force(&self) -> TimeInForce
pub fn time_in_force(&self) -> TimeInForce
Get the time in force
Sourcepub fn is_immediate(&self) -> bool
pub fn is_immediate(&self) -> bool
Check if the order should be canceled after attempting to match
Sourcepub fn has_expiry(&self) -> bool
pub fn has_expiry(&self) -> bool
Check if the order has an expiry time
Sourcepub fn expires_at(&self) -> Option<Timestamp>
pub fn expires_at(&self) -> Option<Timestamp>
Get the timestamp when the order expires, if any
Sourcepub fn is_expired(&self, timestamp: Timestamp) -> bool
pub fn is_expired(&self, timestamp: Timestamp) -> bool
Check if the order is expired at a given timestamp
Trait Implementations§
Source§impl Clone for LimitOrder
impl Clone for LimitOrder
Source§fn clone(&self) -> LimitOrder
fn clone(&self) -> LimitOrder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LimitOrder
impl Debug for LimitOrder
Source§impl Deref for LimitOrder
impl Deref for LimitOrder
Source§impl DerefMut for LimitOrder
impl DerefMut for LimitOrder
Source§impl<'de> Deserialize<'de> for LimitOrder
impl<'de> Deserialize<'de> for LimitOrder
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LimitOrder
impl Display for LimitOrder
Source§impl PartialEq for LimitOrder
impl PartialEq for LimitOrder
Source§impl Serialize for LimitOrder
impl Serialize for LimitOrder
impl Eq for LimitOrder
impl StructuralPartialEq for LimitOrder
Auto Trait Implementations§
impl Freeze for LimitOrder
impl RefUnwindSafe for LimitOrder
impl Send for LimitOrder
impl Sync for LimitOrder
impl Unpin for LimitOrder
impl UnsafeUnpin for LimitOrder
impl UnwindSafe for LimitOrder
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