Skip to main content

TradeStatus

Enum TradeStatus 

Source
#[repr(i32)]
pub enum TradeStatus {
Show 38 variants UNKNOWN = -1, NO_REGISTER_QUOTE = 0, CLEAN = 101, OPEN_BID = 102, MORNING_CLOSING = 103, TRADING = 105, NOON_CLOSING = 106, CLOSE_BID = 107, CLOSING = 108, DARK_WAIT = 110, DARK_TRADING = 111, DARK_CLOSING = 112, AFTER_FIX = 120, HALF_CLOSING = 121, NOT_OPENED = 122, REALTIME_QUOTE = 123, US_PREV = 201, US_TRADING = 202, US_AFTER = 203, US_CLOSING = 204, US_STOP = 205, US_CLEAN = 206, US_NIGHT = 207, US_PREV_MARKET_CLEAN = 209, US_AFTER_MARKET_CLEAN = 210, REFRESH = 1_000, DELIST = 1_001, PREPARE = 1_002, CODE_CHANGE = 1_003, STOP = 1_004, WILL_OPEN = 1_005, COMMON_SUSPEND = 1_006, EXPIRE = 1_007, NO_QUOTE = 1_008, UNITED = 1_009, TRADING_HALT = 1_010, WAIT_LISTING = 1_011, FUSE = 2_001,
}
Expand description

Market trading status code.

Variants§

§

UNKNOWN = -1

Unknown status

§

NO_REGISTER_QUOTE = 0

Quote is not registered

§

CLEAN = 101

Clearing before the market opens.

§

OPEN_BID = 102

Opening auction.

§

MORNING_CLOSING = 103

Morning break, currently used by VIX indexes.

§

TRADING = 105

Regular trading.

§

NOON_CLOSING = 106

Midday break.

§

CLOSE_BID = 107

Closing auction.

§

CLOSING = 108

Market closed.

§

DARK_WAIT = 110

Dark trading waiting to open.

§

DARK_TRADING = 111

Dark trading.

§

DARK_CLOSING = 112

Dark trading closed.

§

AFTER_FIX = 120

After-hours fixed-price trading.

§

HALF_CLOSING = 121

Half-day market closed. Defined by the market status table but currently unused.

§

NOT_OPENED = 122

Not opened because the exchange is waiting to open under special conditions.

§

REALTIME_QUOTE = 123

Temporary intraday break. The historical variant name is kept for compatibility.

§

US_PREV = 201

US pre-market.

§

US_TRADING = 202

US regular trading.

§

US_AFTER = 203

US post-market.

§

US_CLOSING = 204

US closed.

§

US_STOP = 205

US halted.

§

US_CLEAN = 206

US clearing plus pre-market.

§

US_NIGHT = 207

US overnight trading.

§

US_PREV_MARKET_CLEAN = 209

US pre-market clearing alias returned by the quote engine.

§

US_AFTER_MARKET_CLEAN = 210

US post-market clearing alias returned by the quote engine.

§

REFRESH = 1_000

Stock refresh. Deprecated in the status definition.

§

DELIST = 1_001

Delisted.

§

PREPARE = 1_002

Preparing to list.

§

CODE_CHANGE = 1_003

Code changed.

§

STOP = 1_004

Halted.

§

WILL_OPEN = 1_005

Waiting to open, typically for a US IPO auction.

§

COMMON_SUSPEND = 1_006

Split or merge suspended.

§

EXPIRE = 1_007

Expired.

§

NO_QUOTE = 1_008

No quote data.

§

UNITED = 1_009

Not listed. The historical variant name is kept for compatibility.

§

TRADING_HALT = 1_010

Terminated trading, usually for warrants.

§

WAIT_LISTING = 1_011

Waiting to list, usually for new warrants.

§

FUSE = 2_001

Fuse.

Implementations§

Source§

impl TradeStatus

Source

pub const fn from_repr(discriminant: i32) -> Option<TradeStatus>

Try to create Self from the raw representation

Source§

impl TradeStatus

Source

pub fn from_isize(value: isize) -> TradeStatus

Converts an isize value to a market trading status.

Source

pub fn code(self) -> i32

Returns the raw numeric status code.

Source

pub fn as_static(self) -> &'static str

Returns the static enum variant name.

Source

pub fn label(self) -> &'static str

Returns a simplified label for key display states.

Source

pub fn name(self) -> &'static str

Returns the full English status name.

Source

pub fn is_us_market(self) -> bool

Returns whether this is a US market status.

Source

pub fn is_us_pre_post(self) -> bool

Returns whether this is a US pre/post-market status.

Source

pub fn is_us_night(self) -> bool

Returns whether this is a US overnight status.

Source

pub fn is_us_closing(self) -> bool

Returns whether this is a US closed status.

Source

pub fn is_closing(self) -> bool

Returns whether this is a closed status.

Source

pub fn is_us_prev(self) -> bool

Returns whether this is a US pre-market status.

Source

pub fn is_us_after(self) -> bool

Returns whether this is a US post-market status.

Source

pub fn is_trading(self) -> bool

Returns whether this is a trading status.

Source

pub fn is_dark(self) -> bool

Returns whether this is a dark-pool status.

Source

pub fn allow_trading(self) -> bool

Returns whether this status allows trading.

Source

pub fn normalize(self) -> Self

Normalizes clearing aliases to their display-equivalent status.

Source

pub fn is_special(self) -> bool

Returns whether this is a special non-regular status.

Trait Implementations§

Source§

impl Clone for TradeStatus

Source§

fn clone(&self) -> TradeStatus

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 TradeStatus

Source§

impl Debug for TradeStatus

Source§

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

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

impl Default for TradeStatus

Source§

fn default() -> TradeStatus

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TradeStatus

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 Eq for TradeStatus

Source§

impl<'_derivative_strum> From<&'_derivative_strum TradeStatus> for &'static str

Source§

fn from(x: &'_derivative_strum TradeStatus) -> &'static str

Converts to this type from the input type.
Source§

impl From<TradeStatus> for &'static str

Source§

fn from(x: TradeStatus) -> &'static str

Converts to this type from the input type.
Source§

impl From<i32> for TradeStatus

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl Hash for TradeStatus

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 Ord for TradeStatus

Source§

fn cmp(&self, other: &TradeStatus) -> 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 TradeStatus

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for TradeStatus

Source§

fn partial_cmp(&self, other: &TradeStatus) -> 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 TradeStatus

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 TradeStatus

Auto Trait Implementations§

Blanket Implementations§

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
§

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

§

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
§

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

§

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>,

§

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

§

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

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

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

§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more