#[non_exhaustive]#[repr(u8)]pub enum InstrumentClass {
Bond = 66,
Call = 67,
Future = 70,
Stock = 75,
MixedSpread = 77,
Put = 80,
FutureSpread = 83,
OptionSpread = 84,
FxSpot = 88,
CommoditySpot = 89,
}Expand description
The class of instrument.
For example usage see Getting options with their underlying.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bond = 66
A bond.
Call = 67
A call option.
Future = 70
A future.
Stock = 75
A stock.
MixedSpread = 77
A spread composed of multiple instrument classes.
Put = 80
A put option.
FutureSpread = 83
A spread composed of futures.
OptionSpread = 84
A spread composed of options.
FxSpot = 88
A foreign exchange spot.
CommoditySpot = 89
A commodity being traded for immediate delivery.
Implementations§
Source§impl InstrumentClass
impl InstrumentClass
Sourcepub fn is_option(&self) -> bool
pub fn is_option(&self) -> bool
Returns true if the instrument class is a type of option.
Note: excludes Self::MixedSpread, which may include options.
Sourcepub fn is_future(&self) -> bool
pub fn is_future(&self) -> bool
Returns true if the instrument class is a type of future.
Note: excludes Self::MixedSpread, which may include futures.
Trait Implementations§
Source§impl Clone for InstrumentClass
impl Clone for InstrumentClass
Source§fn clone(&self) -> InstrumentClass
fn clone(&self) -> InstrumentClass
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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 From<InstrumentClass> for char
impl From<InstrumentClass> for char
Source§fn from(value: InstrumentClass) -> Self
fn from(value: InstrumentClass) -> Self
Source§impl From<InstrumentClass> for u8
impl From<InstrumentClass> for u8
Source§fn from(enum_value: InstrumentClass) -> Self
fn from(enum_value: InstrumentClass) -> Self
Source§impl<'a, 'py> FromPyObject<'a, 'py> for InstrumentClasswhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for InstrumentClasswhere
Self: Clone,
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<'py> IntoPyObject<'py> for InstrumentClass
impl<'py> IntoPyObject<'py> for InstrumentClass
Source§type Target = InstrumentClass
type Target = InstrumentClass
Source§type Output = Bound<'py, <InstrumentClass as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <InstrumentClass as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'py>>::Output, <Self as IntoPyObject<'py>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'py>>::Output, <Self as IntoPyObject<'py>>::Error>
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 · 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§impl PartialOrd for InstrumentClass
impl PartialOrd for InstrumentClass
Source§impl PyClass for InstrumentClass
impl PyClass for InstrumentClass
Source§impl PyClassImpl for InstrumentClass
impl PyClassImpl for InstrumentClass
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// The class of instrument.
///
/// For example usage see
/// [Getting options with their underlying](https://databento.com/docs/examples/options/options-and-futures).
const RAW_DOC: &'static CStr = /// The class of instrument. /// /// For example usage see /// [Getting options with their underlying](https://databento.com/docs/examples/options/options-and-futures).
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<InstrumentClass as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<InstrumentClass>
type Layout = <<InstrumentClass as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<InstrumentClass>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
Source§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
Source§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for InstrumentClass
Available on crate feature python only.
impl PyClassNewTextSignature for InstrumentClass
python only.const TEXT_SIGNATURE: &'static str = "(value)"
Source§impl PyClass__eq__SlotFragment<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature python only.
impl PyClass__eq__SlotFragment<InstrumentClass> for PyClassImplCollector<InstrumentClass>
python only.Source§impl PyMethods<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature python only.
impl PyMethods<InstrumentClass> for PyClassImplCollector<InstrumentClass>
python only.fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for InstrumentClass
impl PyTypeInfo for InstrumentClass
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Source§impl Serialize for InstrumentClass
impl Serialize for InstrumentClass
Source§impl TryFrom<u8> for InstrumentClass
impl TryFrom<u8> for InstrumentClass
Source§type Error = TryFromPrimitiveError<InstrumentClass>
type Error = TryFromPrimitiveError<InstrumentClass>
Source§impl TryFromPrimitive for InstrumentClass
impl TryFromPrimitive for InstrumentClass
const NAME: &'static str = "InstrumentClass"
type Primitive = u8
type Error = TryFromPrimitiveError<InstrumentClass>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Source§impl WritePyRepr for InstrumentClass
Available on crate feature python only.
impl WritePyRepr for InstrumentClass
python only.Source§fn write_py_repr(&self, s: &mut String) -> Result
fn write_py_repr(&self, s: &mut String) -> Result
s. Read moreSource§const SHOULD_FLATTEN: bool = false
const SHOULD_FLATTEN: bool = false
impl Copy for InstrumentClass
impl Eq 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§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
Source§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.