pub enum Imm {
Wed3_HMUZ = 0,
Wed3 = 1,
Day20_HMUZ = 2,
Day20_HU = 3,
Day20_MZ = 4,
Day20 = 5,
Fri2_HMUZ = 6,
Fri2 = 7,
Wed1_Post9_HMUZ = 10,
Wed1_Post9 = 11,
Eom = 8,
Leap = 9,
}
Expand description
An IMM date definition.
Variants§
Wed3_HMUZ = 0
3rd Wednesday of March, June, September and December.
Commonly used by STIR futures in northern hemisphere.
Wed3 = 1
3rd Wednesday of any calendar month.
Commonly used by STIR futures in northern hemisphere.
Day20_HMUZ = 2
20th day of March, June, September and December.
Commonly used by CDS.
Day20_HU = 3
20th day of March and September.
Commonly used by CDS.
Day20_MZ = 4
20th day of June and December.
Commonly used by CDS.
Day20 = 5
20th day of any calendar month.
Fri2_HMUZ = 6
2nd Friday of March, June, September and December.
Commonly used by ASX 90 day AUD bank bill futures.
Fri2 = 7
2nd Friday of any calendar month.
Commonly used by ASX 90 day AUD bank bill futures.
Wed1_Post9_HMUZ = 10
1st Wednesday after the 9th of the month in March, June, September and December.
Commonly used by ASX 90 day NZD bank bill futures.
Wed1_Post9 = 11
1st Wednesday after the 9th of any calendar month.
Commonly used by ASX 90 day NZD bank bill futures.
Eom = 8
End of any calendar month
Leap = 9
February Leap days
Implementations§
Source§impl Imm
impl Imm
Sourcepub fn validate(&self, date: &NaiveDateTime) -> bool
pub fn validate(&self, date: &NaiveDateTime) -> bool
Check whether a given date aligns with the IMM date definition.
Sourcepub fn from_ym_opt(&self, year: i32, month: u32) -> Result<NaiveDateTime, PyErr>
pub fn from_ym_opt(&self, year: i32, month: u32) -> Result<NaiveDateTime, PyErr>
Get an IMM date with the appropriate definition from a given month and year.
Sourcepub fn next(&self, date: &NaiveDateTime) -> NaiveDateTime
pub fn next(&self, date: &NaiveDateTime) -> NaiveDateTime
Get the IMM date that follows the given date
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Imm
impl<'de> Deserialize<'de> for Imm
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<'py> IntoPyObject<'py> for Imm
impl<'py> IntoPyObject<'py> for Imm
Source§impl PyClassImpl for Imm
impl PyClassImpl for Imm
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§type ThreadChecker = SendablePyClass<Imm>
type ThreadChecker = SendablePyClass<Imm>
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>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<Imm> for PyClassImplCollector<Imm>
impl PyClassNewTextSignature<Imm> for PyClassImplCollector<Imm>
fn new_text_signature(self) -> Option<&'static str>
Source§impl PyMethods<Imm> for PyClassImplCollector<Imm>
impl PyMethods<Imm> for PyClassImplCollector<Imm>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Imm
impl PyTypeInfo for Imm
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type.impl Copy for Imm
impl Eq for Imm
impl StructuralPartialEq for Imm
Auto Trait Implementations§
impl Freeze for Imm
impl RefUnwindSafe for Imm
impl Send for Imm
impl Sync for Imm
impl Unpin for Imm
impl UnwindSafe for Imm
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§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.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self
into an owned Python object, dropping type information and unbinding it
from the 'py
lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self
into a Python object. Read more§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.