#[repr(u8)]pub enum InstrumentClass {
Bond = 66,
Call = 67,
Future = 70,
Stock = 75,
MixedSpread = 77,
Put = 80,
FutureSpread = 83,
OptionSpread = 84,
FxSpot = 88,
}Expand description
The class of instrument.
For example usage see Getting options with their underlying.
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.
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 copy 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 PartialEq for InstrumentClass
impl PartialEq 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§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
Available on non-crate feature
gil-refs only.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<'a, 'py> PyFunctionArgument<'a, 'py> for &'a InstrumentClass
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a InstrumentClass
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut InstrumentClass
impl<'a, 'py> PyFunctionArgument<'a, 'py> 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_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)