#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InstrumentClass
impl Debug for InstrumentClass
Source§impl From<InstrumentClass> for char
impl From<InstrumentClass> for char
Source§fn from(class: InstrumentClass) -> Self
fn from(class: InstrumentClass) -> Self
Converts to this type from the input type.
Source§impl From<InstrumentClass> for u8
impl From<InstrumentClass> for u8
Source§fn from(enum_value: InstrumentClass) -> Self
fn from(enum_value: InstrumentClass) -> Self
Converts to this type from the input type.
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
The Python output type
Source§type Output = Bound<'py, <InstrumentClass as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <InstrumentClass as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
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,
Compares and returns the maximum of two values. Read more
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
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§type ThreadChecker = SendablePyClass<InstrumentClass>
type ThreadChecker = SendablePyClass<InstrumentClass>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature python only.
impl PyClassNewTextSignature<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature
python only.fn new_text_signature(self) -> Option<&'static str>
Source§impl PyClass__eq__SlotFragment<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature python only.
impl PyClass__eq__SlotFragment<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature
python only.Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a InstrumentClass
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a InstrumentClass
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut InstrumentClass
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut InstrumentClass
Source§impl PyMethods<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature python only.
impl PyMethods<InstrumentClass> for PyClassImplCollector<InstrumentClass>
Available on crate feature
python only.fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for InstrumentClass
impl PyTypeInfo for InstrumentClass
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
Source§impl TryFrom<u8> for InstrumentClass
impl TryFrom<u8> for InstrumentClass
Source§type Error = TryFromPrimitiveError<InstrumentClass>
type Error = TryFromPrimitiveError<InstrumentClass>
The type returned in the event of a conversion error.
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>>
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 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
Source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
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>
Converts
self into an owned Python object, dropping type information.