Enum dbn::enums::InstrumentClass
source · #[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 HasPyGilRef for InstrumentClass
impl HasPyGilRef for InstrumentClass
§type AsRefTarget = PyCell<InstrumentClass>
type AsRefTarget = PyCell<InstrumentClass>
Utility type to make Py::as_ref work.
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§fn eq(&self, other: &InstrumentClass) -> bool
fn eq(&self, other: &InstrumentClass) -> bool
This method tests for
self and other values to be equal, and is used
by ==.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)]
§type ThreadChecker = SendablePyClass<InstrumentClass>
type ThreadChecker = SendablePyClass<InstrumentClass>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§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<'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(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
👎Deprecated since 0.21.0:
PyTypeInfo::type_object will be replaced by PyTypeInfo::type_object_bound in a future PyO3 versionReturns the safe abstraction over the type object.
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§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
👎Deprecated since 0.21.0:
PyTypeInfo::is_type_of will be replaced by PyTypeInfo::is_type_of_bound in a future PyO3 versionChecks if
object is an instance of this type or a subclass of this type.source§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
👎Deprecated since 0.21.0:
PyTypeInfo::is_exact_type_of will be replaced by PyTypeInfo::is_exact_type_of_bound in a future PyO3 versionChecks if
object is an instance of this type.source§impl TryFrom<u8> for InstrumentClass
impl TryFrom<u8> for InstrumentClass
§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
type Primitive = u8
type Error = TryFromPrimitiveError<InstrumentClass>
const NAME: &'static str = "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