pub enum TimeInForce {
Gtc,
Ioc,
Fok,
Gtd(Timestamp),
}Expand description
Specifies how long an order remains active before it is executed or expires.
Variants§
Gtc
Good ’Til Canceled - The order remains active until it is filled or canceled.
Ioc
Immediate Or Cancel - The order must be filled immediately in its entirety. If the order cannot be filled completely, the unfilled portion is canceled.
Fok
Fill Or Kill - The order must be filled immediately and completely. If the order cannot be filled entirely, the entire order is canceled.
Gtd(Timestamp)
Good ’Til Date - The order remains active until a specified date and time.
Implementations§
Source§impl TimeInForce
impl TimeInForce
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
Checks if an order with this time in force has expired
Trait Implementations§
Source§impl Clone for TimeInForce
impl Clone for TimeInForce
Source§fn clone(&self) -> TimeInForce
fn clone(&self) -> TimeInForce
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 TimeInForce
impl Debug for TimeInForce
Source§impl<'de> Deserialize<'de> for TimeInForce
impl<'de> Deserialize<'de> for TimeInForce
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 TimeInForce
impl Display for TimeInForce
Source§impl PartialEq for TimeInForce
impl PartialEq for TimeInForce
Source§impl Serialize for TimeInForce
impl Serialize for TimeInForce
impl Copy for TimeInForce
impl Eq for TimeInForce
impl StructuralPartialEq for TimeInForce
Auto Trait Implementations§
impl Freeze for TimeInForce
impl RefUnwindSafe for TimeInForce
impl Send for TimeInForce
impl Sync for TimeInForce
impl Unpin for TimeInForce
impl UnsafeUnpin for TimeInForce
impl UnwindSafe for TimeInForce
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