Skip to main content

OrderStatus

Enum OrderStatus 

Source
#[repr(C)]
pub enum OrderStatus {
Show 15 variants Initialized = 1, Denied = 2, Emulated = 3, Released = 4, Submitted = 5, Accepted = 6, Rejected = 7, Canceled = 8, Expired = 9, Triggered = 10, PendingUpdate = 11, PendingCancel = 12, PartiallyFilled = 13, Filled = 14, Voided = 15,
}
Expand description

The status for a specific order.

An order is considered open for the following status:

  • ACCEPTED
  • TRIGGERED
  • PENDING_UPDATE
  • PENDING_CANCEL
  • PARTIALLY_FILLED

An order is considered in-flight for the following status:

  • SUBMITTED
  • PENDING_UPDATE
  • PENDING_CANCEL

An order is considered closed for the following status:

  • DENIED
  • REJECTED
  • CANCELED
  • EXPIRED
  • FILLED
  • VOIDED

Variants§

§

Initialized = 1

The order is initialized (instantiated) within the Nautilus system.

§

Denied = 2

The order was denied by the Nautilus system, either for being invalid, unprocessable, or exceeding a risk limit.

§

Emulated = 3

The order became emulated by the Nautilus system in the OrderEmulator component.

§

Released = 4

The order was released by the Nautilus system from the OrderEmulator component.

§

Submitted = 5

The order was submitted by the Nautilus system to the external service or trading venue (awaiting acknowledgement).

§

Accepted = 6

The order was acknowledged by the trading venue as being received and valid (may now be working).

§

Rejected = 7

The order was rejected by the trading venue.

§

Canceled = 8

The order was canceled (closed/done).

§

Expired = 9

The order reached a GTD expiration (closed/done).

§

Triggered = 10

The order STOP price was triggered on a trading venue.

§

PendingUpdate = 11

The order is currently pending a request to modify on a trading venue.

§

PendingCancel = 12

The order is currently pending a request to cancel on a trading venue.

§

PartiallyFilled = 13

The order has been partially filled on a trading venue.

§

Filled = 14

The order has been completely filled on a trading venue (closed/done).

§

Voided = 15

The order is terminal after an authoritative venue void or fill correction.

Implementations§

Source§

impl OrderStatus

Source

pub const fn from_repr(discriminant: usize) -> Option<OrderStatus>

Try to create Self from the raw representation

Source§

impl OrderStatus

Source

pub const fn is_open(self) -> bool

Returns whether the order status represents an open/working order.

Source

pub const fn is_closed(self) -> bool

Returns whether the order status represents a terminal (closed) state.

Source

pub const fn is_cancellable(self) -> bool

Returns whether the order can be cancelled from this status.

Source§

impl OrderStatus

Source

pub fn transition(&mut self, event: &OrderEventAny) -> Result<Self, OrderError>

Transitions the order state machine based on the given event.

§Errors

Returns an error if the state transition is invalid from the current status.

Trait Implementations§

Source§

impl AsRef<str> for OrderStatus

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for OrderStatus

Source§

fn clone(&self) -> OrderStatus

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OrderStatus

Source§

impl Debug for OrderStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OrderStatus

Source§

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 OrderStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for OrderStatus

Source§

impl FromStr for OrderStatus

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<OrderStatus, <Self as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for OrderStatus

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoEnumIterator for OrderStatus

Source§

impl Ord for OrderStatus

Source§

fn cmp(&self, other: &OrderStatus) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for OrderStatus

Source§

fn eq(&self, other: &OrderStatus) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for OrderStatus

Source§

fn partial_cmp(&self, other: &OrderStatus) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for OrderStatus

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for OrderStatus

Source§

impl TryFrom<&str> for OrderStatus

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(s: &str) -> Result<OrderStatus, <Self as TryFrom<&str>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.