pub enum InstrumentType {
Stock,
Bond,
Options,
Futures,
MutualFunds,
Currency,
Etf,
}Expand description
Instrument type, as the broker names it in its upper-case form.
This enum covers seven kinds only. The broker’s reference data has more (FOREIGN_STOCK, NOTES,
DEPOSITARY_RECEIPTS, EURO_BONDS, GOODS, INDICES) and spells bonds BONDS, not BOND. The
request and response models of crate::http::models therefore keep the instrument type as a
string, and this enum is for code that works with the narrow set. Do not rely on it to parse all
broker replies.
§Examples
use brokapi_bcs_protocol::models::enums::InstrumentType;
let t: InstrumentType = serde_json::from_str("\"MUTUAL_FUNDS\"")?;
assert_eq!(t, InstrumentType::MutualFunds);
assert_eq!(serde_json::to_string(&InstrumentType::Etf)?, "\"ETF\"");Variants§
Stock
Share (STOCK).
Bond
Bond (BOND). The broker’s own name for bonds in reference data is BONDS.
Options
Option (OPTIONS).
Futures
Future (FUTURES).
MutualFunds
Mutual fund (MUTUAL_FUNDS).
Currency
Currency (CURRENCY).
Etf
Exchange-traded fund (ETF).
Trait Implementations§
Source§impl Clone for InstrumentType
impl Clone for InstrumentType
Source§fn clone(&self) -> InstrumentType
fn clone(&self) -> InstrumentType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for InstrumentType
Source§impl Debug for InstrumentType
impl Debug for InstrumentType
Source§impl<'de> Deserialize<'de> for InstrumentType
impl<'de> Deserialize<'de> for InstrumentType
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
impl Eq for InstrumentType
Source§impl PartialEq for InstrumentType
impl PartialEq for InstrumentType
Source§fn eq(&self, other: &InstrumentType) -> bool
fn eq(&self, other: &InstrumentType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for InstrumentType
impl Serialize for InstrumentType
impl StructuralPartialEq for InstrumentType
Auto Trait Implementations§
impl Freeze for InstrumentType
impl RefUnwindSafe for InstrumentType
impl Send for InstrumentType
impl Sync for InstrumentType
impl Unpin for InstrumentType
impl UnsafeUnpin for InstrumentType
impl UnwindSafe for InstrumentType
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.