#[repr(C)]pub enum InstrumentClass {
Spot = 1,
Swap = 2,
Future = 3,
FuturesSpread = 4,
Forward = 5,
Cfd = 6,
Bond = 7,
Option = 8,
OptionSpread = 9,
Warrant = 10,
SportsBetting = 11,
BinaryOption = 12,
}Expand description
The instrument class.
Variants§
Spot = 1
A spot market instrument class. The current market price of an instrument that is bought or sold for immediate delivery and payment.
Swap = 2
A swap instrument class. A derivative contract through which two parties exchange the cash flows or liabilities from two different financial instruments.
Future = 3
A futures contract instrument class. A legal agreement to buy or sell an asset at a predetermined price at a specified time in the future.
FuturesSpread = 4
A futures spread instrument class. A strategy involving the use of futures contracts to take advantage of price differentials between different contract months, underlying assets, or marketplaces.
Forward = 5
A forward derivative instrument class. A customized contract between two parties to buy or sell an asset at a specified price on a future date.
Cfd = 6
A contract-for-difference (CFD) instrument class. A contract between an investor and a CFD broker to exchange the difference in the value of a financial product between the time the contract opens and closes.
Bond = 7
A bond instrument class. A type of debt investment where an investor loans money to an entity (typically corporate or governmental) which borrows the funds for a defined period of time at a variable or fixed interest rate.
Option = 8
An option contract instrument class. A type of derivative that gives the holder the right, but not the obligation, to buy or sell an underlying asset at a predetermined price before or at a certain future date.
OptionSpread = 9
An option spread instrument class. A strategy involving the purchase and/or sale of multiple option contracts on the same underlying asset with different strike prices or expiration dates to hedge risk or speculate on price movements.
Warrant = 10
A warrant instrument class. A derivative that gives the holder the right, but not the obligation, to buy or sell a security—most commonly an equity—at a certain price before expiration.
SportsBetting = 11
A sports betting instrument class. A financialized derivative that allows wagering on the outcome of sports events using structured contracts or prediction markets.
BinaryOption = 12
A binary option instrument class. A type of derivative where the payoff is either a fixed monetary amount or nothing, depending on whether the price of an underlying asset is above or below a predetermined level at expiration.
Implementations§
Source§impl InstrumentClass
impl InstrumentClass
Sourcepub const fn has_expiration(&self) -> bool
pub const fn has_expiration(&self) -> bool
Returns whether this instrument class has an expiration.
Sourcepub const fn allows_negative_price(&self) -> bool
pub const fn allows_negative_price(&self) -> bool
Returns whether this instrument class allows negative prices.
Sourcepub fn try_from_parent_suffix(suffix: &str) -> Option<Self>
pub fn try_from_parent_suffix(suffix: &str) -> Option<Self>
Returns the InstrumentClass for the parent-symbol suffix, if recognised.
Matches strict uppercase forms only. Both Databento-style abbreviations
(FUT, OPT) and long forms (FUTURE, OPTION) are accepted.
Sourcepub const fn parent_suffix(self) -> Option<&'static str>
pub const fn parent_suffix(self) -> Option<&'static str>
Returns the canonical parent-symbol suffix for this class, if one exists.
Always emits the short form (FUT, OPT) so that adapters constructing
parent ids produce a single canonical string per class.
Trait Implementations§
Source§impl AsRef<str> for InstrumentClass
impl AsRef<str> for InstrumentClass
Source§impl Clone for InstrumentClass
impl Clone for InstrumentClass
Source§fn clone(&self) -> InstrumentClass
fn clone(&self) -> InstrumentClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InstrumentClass
Source§impl Debug for InstrumentClass
impl Debug for InstrumentClass
Source§impl<'de> Deserialize<'de> for InstrumentClass
impl<'de> Deserialize<'de> for InstrumentClass
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>,
Source§impl Display for InstrumentClass
impl Display for InstrumentClass
impl Eq for InstrumentClass
Source§impl FromStr for InstrumentClass
impl FromStr for InstrumentClass
Source§impl Hash for InstrumentClass
impl Hash for InstrumentClass
Source§impl IntoEnumIterator for InstrumentClass
impl IntoEnumIterator for InstrumentClass
type Iterator = InstrumentClassIter
fn iter() -> InstrumentClassIter ⓘ
Source§impl Ord for InstrumentClass
impl Ord for InstrumentClass
Source§fn cmp(&self, other: &InstrumentClass) -> Ordering
fn cmp(&self, other: &InstrumentClass) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for InstrumentClass
impl PartialEq for InstrumentClass
Source§fn eq(&self, other: &InstrumentClass) -> bool
fn eq(&self, other: &InstrumentClass) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for InstrumentClass
impl PartialOrd for InstrumentClass
Source§impl Serialize for InstrumentClass
impl Serialize for InstrumentClass
impl StructuralPartialEq for InstrumentClass
Auto Trait Implementations§
impl Freeze for InstrumentClass
impl RefUnwindSafe for InstrumentClass
impl Send for InstrumentClass
impl Sync for InstrumentClass
impl Unpin for InstrumentClass
impl UnsafeUnpin for InstrumentClass
impl UnwindSafe for InstrumentClass
Blanket Implementations§
impl<T> Allocation for T
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
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.