Trait Crossing
pub(crate) trait Crossing: Sized {
type Py: for<'py> FromPyObject<'py>;
const LABEL: &'static str;
const CLASS: &'static str;
// Required methods
fn from_class(value: Self::Py) -> PyResult<Self>;
fn from_spelling(spelling: &str) -> PyResult<Self>;
// Provided method
fn from_other(_ob: &Bound<'_, PyAny>) -> Option<Self> { ... }
}Expand description
A core vocabulary that reaches Python as a class.
Required Associated Constants§
Required Associated Types§
type Py: for<'py> FromPyObject<'py>
type Py: for<'py> FromPyObject<'py>
The Python class a value of this vocabulary crosses as.
Required Methods§
fn from_class(value: Self::Py) -> PyResult<Self>
fn from_class(value: Self::Py) -> PyResult<Self>
The core value a class instance carries. Fallible for the one case
where a class value has no reading in the target — Frequency.Once
where a recurring period is wanted.
fn from_spelling(spelling: &str) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
The core value a spelling names, with the core’s own rejection.
Provided Methods§
fn from_other(_ob: &Bound<'_, PyAny>) -> Option<Self>
fn from_other(_ob: &Bound<'_, PyAny>) -> Option<Self>
The core value another class carries where the vocabulary takes one
beside its own — a frequency slot takes a Period — or None.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
§impl Crossing for AccrualCompounding
impl Crossing for AccrualCompounding
const LABEL: &'static str = "an accrual compounding"
const CLASS: &'static str = "AccrualCompounding"
type Py = PyAccrualCompounding
fn from_class(value: PyAccrualCompounding) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for AccrualOnDefault
impl Crossing for AccrualOnDefault
const LABEL: &'static str = "an accrual-on-default convention"
const CLASS: &'static str = "AccrualOnDefault"
type Py = PyAccrualOnDefault
fn from_class(value: PyAccrualOnDefault) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for Aggregation
impl Crossing for Aggregation
const LABEL: &'static str = "an aggregation"
const CLASS: &'static str = "Aggregation"
type Py = PyAggregation
fn from_class(value: PyAggregation) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for AssetSwapKind
impl Crossing for AssetSwapKind
const LABEL: &'static str = "an asset swap convention"
const CLASS: &'static str = "AssetSwapKind"
type Py = PyAssetSwapKind
fn from_class(value: PyAssetSwapKind) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for BarrierKind
impl Crossing for BarrierKind
const LABEL: &'static str = "a barrier kind"
const CLASS: &'static str = "BarrierKind"
type Py = PyBarrierKind
fn from_class(value: PyBarrierKind) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for BondOptionEngine
impl Crossing for BondOptionEngine
const LABEL: &'static str = "a bond option engine"
const CLASS: &'static str = "BondOptionEngine"
type Py = PyBondOptionEngine
fn from_class(value: PyBondOptionEngine) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for BondStrikeKind
impl Crossing for BondStrikeKind
const LABEL: &'static str = "a bond strike kind"
const CLASS: &'static str = "BondStrikeKind"
type Py = PyBondStrikeKind
fn from_class(value: PyBondStrikeKind) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for BusinessDayConvention
impl Crossing for BusinessDayConvention
const LABEL: &'static str = "a business-day convention"
const CLASS: &'static str = "BusinessDayConvention"
type Py = PyBusinessDayConvention
fn from_class(value: PyBusinessDayConvention) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for CallKind
impl Crossing for CallKind
const LABEL: &'static str = "a call kind"
const CLASS: &'static str = "CallKind"
type Py = PyCallKind
fn from_class(value: PyCallKind) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for CapFloorKind
impl Crossing for CapFloorKind
const LABEL: &'static str = "a cap-floor kind"
const CLASS: &'static str = "CapFloorKind"
type Py = PyCapFloorKind
fn from_class(value: PyCapFloorKind) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for CdsOptionStyle
impl Crossing for CdsOptionStyle
const LABEL: &'static str = "a CDS option style"
const CLASS: &'static str = "CdsOptionStyle"
type Py = PyCdsOptionStyle
fn from_class(value: PyCdsOptionStyle) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for CdsStrikeType
impl Crossing for CdsStrikeType
const LABEL: &'static str = "a CDS option strike type"
const CLASS: &'static str = "CdsStrikeType"
type Py = PyCdsStrikeType
fn from_class(value: PyCdsStrikeType) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for CmeMaturityRounding
impl Crossing for CmeMaturityRounding
const LABEL: &'static str = "a CME maturity rounding"
const CLASS: &'static str = "CmeMaturityRounding"
type Py = PyCmeMaturityRounding
fn from_class(value: PyCmeMaturityRounding) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for DayCountFraction
impl Crossing for DayCountFraction
const LABEL: &'static str = "a day count"
const CLASS: &'static str = "DayCountFraction"
type Py = PyDayCountFraction
fn from_class(value: PyDayCountFraction) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for DefaultPaymentTime
impl Crossing for DefaultPaymentTime
const LABEL: &'static str = "a default payment time"
const CLASS: &'static str = "DefaultPaymentTime"
type Py = PyDefaultPaymentTime
fn from_class(value: PyDefaultPaymentTime) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for DeltaConvention
impl Crossing for DeltaConvention
const LABEL: &'static str = "a delta convention"
const CLASS: &'static str = "DeltaConvention"
type Py = PyDeltaConvention
fn from_class(value: PyDeltaConvention) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for Direction
impl Crossing for Direction
const LABEL: &'static str = "a direction"
const CLASS: &'static str = "Direction"
type Py = PyDirection
fn from_class(value: PyDirection) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for ExDivDayType
impl Crossing for ExDivDayType
const LABEL: &'static str = "an ex-dividend day type"
const CLASS: &'static str = "ExDivDayType"
type Py = PyExDivDayType
fn from_class(value: PyExDivDayType) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for ExerciseStyle
impl Crossing for ExerciseStyle
const LABEL: &'static str = "an exercise style"
const CLASS: &'static str = "ExerciseStyle"
type Py = PyExerciseStyle
fn from_class(value: PyExerciseStyle) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for Frequency
impl Crossing for Frequency
const LABEL: &'static str = "a frequency"
const CLASS: &'static str = "Frequency"
type Py = PyFrequency
fn from_class(value: PyFrequency) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for JointCalendarRule
impl Crossing for JointCalendarRule
const LABEL: &'static str = "a joint calendar rule"
const CLASS: &'static str = "JointCalendarRule"
type Py = PyJointCalendarRule
fn from_class(value: PyJointCalendarRule) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for LevelInterpolation
impl Crossing for LevelInterpolation
const LABEL: &'static str = "a level interpolation"
const CLASS: &'static str = "LevelInterpolation"
type Py = PyLevelInterpolation
fn from_class(value: PyLevelInterpolation) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for OptionKind
impl Crossing for OptionKind
const LABEL: &'static str = "an option kind"
const CLASS: &'static str = "OptionKind"
type Py = PyOptionKind
fn from_class(value: PyOptionKind) -> PyResult<Self>
fn from_spelling(spelling: &str) -> PyResult<Self>
§impl Crossing for Period
A Frequency where the core reads a recurring period: the member’s period,
a Period, or any tenor spelled as a string ("1Y", "28D"). Frequency.Once has no
period and is refused.
impl Crossing for Period
A Frequency where the core reads a recurring period: the member’s period,
a Period, or any tenor spelled as a string ("1Y", "28D"). Frequency.Once has no
period and is refused.