Struct PyRung
pub struct PyRung {
pub(crate) inner: Rung,
}Expand description
One rung of a ladder with its quote kind declared: the shape a triple cannot say. A triple stays the par shorthand.
Fields§
§inner: RungImplementations§
§impl PyRung
impl PyRung
pub(crate) fn __repr__(&self) -> String
pub(crate) fn par(
pillar: NaiveDate,
instrument: &PyInstrument,
quote: f64,
) -> Self
pub(crate) fn par( pillar: NaiveDate, instrument: &PyInstrument, quote: f64, ) -> Self
A rung at par: the instrument is worth nothing, quote is its par rate.
pub(crate) fn spread(
pillar: NaiveDate,
instrument: &PyInstrument,
quote: f64,
) -> Self
pub(crate) fn spread( pillar: NaiveDate, instrument: &PyInstrument, quote: f64, ) -> Self
A rung quoted as a spread on its floating leg, worth nothing at it.
pub(crate) fn priced(
pillar: NaiveDate,
instrument: &PyInstrument,
quote: f64,
money_per_quote: f64,
settlement: Option<NaiveDate>,
) -> Self
pub(crate) fn priced( pillar: NaiveDate, instrument: &PyInstrument, quote: f64, money_per_quote: f64, settlement: Option<NaiveDate>, ) -> Self
A rung at a price: the instrument is worth quote × money_per_quote,
on settlement when the price is for a later date than the curve’s
reference — a bond quoted T+1 — and today otherwise.
pub(crate) fn upfront(
pillar: NaiveDate,
cds: &PyInstrument,
upfront: f64,
) -> PyResult<Self>
pub(crate) fn upfront( pillar: NaiveDate, cds: &PyInstrument, upfront: f64, ) -> PyResult<Self>
An upfront-quoted credit default swap: the contract without its
upfront, priced at upfront per unit notional.
pub(crate) fn instrument(&self) -> PyInstrument
pub(crate) fn instrument(&self) -> PyInstrument
The rung’s instrument, to be priced back on a solved curve.
Trait Implementations§
impl DerefToPyAny for PyRung
§impl PyClassImpl for PyRung
impl PyClassImpl for PyRung
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type ThreadChecker = SendablePyClass<PyRung>
type ThreadChecker = SendablePyClass<PyRung>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
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>
§impl PyMethods<PyRung> for PyClassImplCollector<PyRung>
impl PyMethods<PyRung> for PyClassImplCollector<PyRung>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyRung
impl PyTypeInfo for PyRung
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§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.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type.Auto Trait Implementations§
impl !RefUnwindSafe for PyRung
impl !UnwindSafe for PyRung
impl Freeze for PyRung
impl Send for PyRung
impl Sync for PyRung
impl Unpin for PyRung
impl UnsafeUnpin for PyRung
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