Struct PyAnyCoupon
pub(crate) struct PyAnyCoupon {
pub(crate) inner: AnyCoupon,
}Expand description
One coupon of the closed set.
Opaque: it carries no constructor of its own, so the only way to hold one is through the four functions below. That is where the closed set is enforced — in the core’s own enumeration, reached through named constructors, rather than in a kind string this class would have to validate.
Fields§
§inner: AnyCouponImplementations§
§impl PyAnyCoupon
impl PyAnyCoupon
fn __eq__(&self, other: &Self) -> bool
fn __eq__(&self, other: &Self) -> bool
Structural equality: the same coupon shape with the same terms.
fn payment_date(&self) -> NaiveDate
fn payment_date(&self) -> NaiveDate
The payment date.
fn accrual_start(&self) -> Option<NaiveDate>
fn accrual_start(&self) -> Option<NaiveDate>
Accrual start, or None for a coupon that accrues over nothing.
fn accrual_end(&self) -> Option<NaiveDate>
fn accrual_end(&self) -> Option<NaiveDate>
Accrual end, or None for a coupon that accrues over nothing.
fn fixing_date(&self) -> Option<NaiveDate>
fn fixing_date(&self) -> Option<NaiveDate>
The reset date, for a coupon that has one.
fn notional(&self) -> f64
fn notional(&self) -> f64
The notional the coupon accrues on.
Zero for a redemption, which accrues on nothing. Its amount is
amount.
fn amount(&self) -> Option<f64>
fn amount(&self) -> Option<f64>
The amount this flow pays, where the contract alone fixes it.
A redemption’s stated amount, and a fixed coupon’s notional times rate
times year fraction. None for a coupon whose rate must be fixed or
projected — zero would be indistinguishable from a coupon that pays
nothing, and the reading that projects is cashflow_records, which
takes a market.
fn year_fraction(&self) -> f64
fn year_fraction(&self) -> f64
The accrual year fraction under the coupon’s own day count.
fn day_count(&self) -> Option<&'static str>
fn day_count(&self) -> Option<&'static str>
The basis the coupon accrues on, or None for one that accrues over
nothing — the code the core’s own vocabulary round-trips.
fn contract_rate(&self) -> Option<f64>
fn contract_rate(&self) -> Option<f64>
The rate written into the contract, for a coupon that carries one — a fixed rate, never a projection.
fn __repr__(&self) -> String
§impl PyAnyCoupon
impl PyAnyCoupon
unsafe fn __pymethod___eq____( py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject, ) -> PyResult<*mut PyObject>
§impl PyAnyCoupon
impl PyAnyCoupon
unsafe extern "C" fn __pymethod___richcmp____( slf: *mut PyObject, other: *mut PyObject, op: c_int, ) -> *mut PyObject
Trait Implementations§
§impl Clone for PyAnyCoupon
impl Clone for PyAnyCoupon
§fn clone(&self) -> PyAnyCoupon
fn clone(&self) -> PyAnyCoupon
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl DerefToPyAny for PyAnyCoupon
§impl IntoPy<Py<PyAny>> for PyAnyCoupon
impl IntoPy<Py<PyAny>> for PyAnyCoupon
§impl PyClass for PyAnyCoupon
impl PyClass for PyAnyCoupon
§impl PyClassImpl for PyAnyCoupon
impl PyClassImpl for PyAnyCoupon
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = SendablePyClass<PyAnyCoupon>
type ThreadChecker = SendablePyClass<PyAnyCoupon>
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
§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>
§impl PyClass__eq__SlotFragment<PyAnyCoupon> for PyClassImplCollector<PyAnyCoupon>
impl PyClass__eq__SlotFragment<PyAnyCoupon> for PyClassImplCollector<PyAnyCoupon>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyAnyCoupon
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyAnyCoupon
§impl PyMethods<PyAnyCoupon> for PyClassImplCollector<PyAnyCoupon>
impl PyMethods<PyAnyCoupon> for PyClassImplCollector<PyAnyCoupon>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyAnyCoupon
impl PyTypeInfo for PyAnyCoupon
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.