pub enum Convention {
Show 14 variants
Act365F = 0,
Act360 = 1,
Thirty360 = 2,
ThirtyU360 = 3,
ThirtyE360 = 4,
ThirtyE360ISDA = 5,
YearsAct365F = 6,
YearsAct360 = 7,
YearsMonths = 8,
One = 9,
ActActISDA = 10,
ActActICMA = 11,
Bus252 = 12,
ActActICMAStubAct365F = 13,
}Expand description
Specifier for day count conventions
Variants§
Act365F = 0
Actual days in period divided by 365.
Act360 = 1
Actual days in period divided by 360.
Thirty360 = 2
30 days in month and 360 days in year with month end modification rules.
- Start day is min(30, start day).
- End day is min(30, end day) if start day is 30.
ThirtyU360 = 3
30 days in month and 360 days in year with month end modification rules.
- Start day is min(30, start day) or 30 if start day is EoM February and roll is EoM.
- End day is min(30, end day) if start day is 30, or 30 if start and end are EoM February and roll is EoM.
For dcf: requires frequency with a RollDay for February EoM adjustment.
ThirtyE360 = 4
30 days in month and 360 days in year with month end modification rules.
- Start day is min(30, start day).
- End day is min(30, end day).
ThirtyE360ISDA = 5
30 days in month and 360 days in year with month end modification rules.
- Start day is min(30, start day) or 30 if start day is February EoM.
- End day is min(30, end day) or 30 if end day is February EoM and not Leg termination.
For dcf: requires termination for February EoM adjustments.
YearsAct365F = 6
Number of whole years plus fractional end period according to ‘Act365F’.
YearsAct360 = 7
Number of whole years plus fractional end period according to ‘Act360’.
YearsMonths = 8
Number of whole years plus fractional counting months difference divided by 12.
One = 9
Return 1.0 for any period.
ActActISDA = 10
Actual days divided by actual days with leap year modification rules.
ActActICMA = 11
Day count based on Frequency definition.
For dcf: requires frequency and stub in all cases.
If a stub period further requires termination, calendar and adjuster to
accurately evaluate the fractional part of a period.
Bus252 = 12
Number of business days in period divided by 252.
For dcf: a calendar is required. If not given, a Calendar will
attempt to be sourced from the frequency if given a BusDays variant.
ActActICMAStubAct365F = 13
ActActICMA falling back to Act365F in stub periods.
For dcf: requires the same arguments as ActActICMA variant.
Implementations§
Source§impl Convention
impl Convention
Trait Implementations§
Source§impl Clone for Convention
impl Clone for Convention
Source§fn clone(&self) -> Convention
fn clone(&self) -> Convention
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Convention
impl Debug for Convention
Source§impl<'de> Deserialize<'de> for Convention
impl<'de> Deserialize<'de> for Convention
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 Hash for Convention
impl Hash for Convention
Source§impl<'py> IntoPyObject<'py> for Convention
impl<'py> IntoPyObject<'py> for Convention
Source§type Target = Convention
type Target = Convention
Source§type Output = Bound<'py, <Convention as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Convention as IntoPyObject<'py>>::Target>
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>
Source§impl JSON for Convention
impl JSON for Convention
Source§impl PartialEq for Convention
impl PartialEq for Convention
Source§impl PyClassImpl for Convention
impl PyClassImpl for Convention
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<Convention>
type ThreadChecker = SendablePyClass<Convention>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
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<Convention> for PyClassImplCollector<Convention>
impl PyClassNewTextSignature<Convention> for PyClassImplCollector<Convention>
fn new_text_signature(self) -> Option<&'static str>
Source§impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a Convention
impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a Convention
Source§impl PyMethods<Convention> for PyClassImplCollector<Convention>
impl PyMethods<Convention> for PyClassImplCollector<Convention>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Convention
impl PyTypeInfo for Convention
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.Source§impl Serialize for Convention
impl Serialize for Convention
impl Copy for Convention
impl StructuralPartialEq for Convention
Auto Trait Implementations§
impl Freeze for Convention
impl RefUnwindSafe for Convention
impl Send for Convention
impl Sync for Convention
impl Unpin for Convention
impl UnwindSafe for Convention
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<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.