Skip to main content

Crossing

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§

const LABEL: &'static str

The vocabulary, named for a refusal: “a business-day convention”.

const CLASS: &'static str

The class, named for a refusal: “BusinessDayConvention”.

Required Associated Types§

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>

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>

The core value a spelling names, with the core’s own rejection.

Provided Methods§

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

§

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

§

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

§

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

§

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

§

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 Basis

§

const LABEL: &'static str = "a risk basis"

§

const CLASS: &'static str = "Basis"

§

type Py = PyBasis

§

fn from_class(value: PyBasis) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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 LegRole

§

const LABEL: &'static str = "a credit-linked leg role"

§

const CLASS: &'static str = "LegRole"

§

type Py = PyLegRole

§

fn from_class(value: PyLegRole) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

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 Measure

§

const LABEL: &'static str = "a measure"

§

const CLASS: &'static str = "Measure"

§

type Py = PyMeasure

§

fn from_class(value: PyMeasure) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

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.

§

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>

§

fn from_other(ob: &Bound<'_, PyAny>) -> Option<Self>

§

impl Crossing for PremiumStyle

§

const LABEL: &'static str = "a premium style"

§

const CLASS: &'static str = "PremiumStyle"

§

type Py = PyPremiumStyle

§

fn from_class(value: PyPremiumStyle) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for PriceBasis

§

const LABEL: &'static str = "a price basis"

§

const CLASS: &'static str = "PriceBasis"

§

type Py = PyPriceBasis

§

fn from_class(value: PyPriceBasis) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for RepackEngine

§

const LABEL: &'static str = "a repack engine"

§

const CLASS: &'static str = "RepackEngine"

§

type Py = PyRepackEngine

§

fn from_class(value: PyRepackEngine) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for RepackRole

§

const LABEL: &'static str = "a repack role"

§

const CLASS: &'static str = "RepackRole"

§

type Py = PyRepackRole

§

fn from_class(value: PyRepackRole) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for ResetCompounding

§

const LABEL: &'static str = "a reset compounding"

§

const CLASS: &'static str = "ResetCompounding"

§

type Py = PyResetCompounding

§

fn from_class(value: PyResetCompounding) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for RiskAxis

§

const LABEL: &'static str = "a risk axis"

§

const CLASS: &'static str = "Axis"

§

type Py = PyRiskAxis

§

fn from_class(value: PyRiskAxis) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for RollConvention

§

const LABEL: &'static str = "a roll convention"

§

const CLASS: &'static str = "RollConvention"

§

type Py = PyRollConvention

§

fn from_class(value: PyRollConvention) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for SabrFormula

§

const LABEL: &'static str = "a SABR formula"

§

const CLASS: &'static str = "SabrFormula"

§

type Py = PySabrFormula

§

fn from_class(value: PySabrFormula) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for Scale

§

const LABEL: &'static str = "a scale"

§

const CLASS: &'static str = "Scale"

§

type Py = PyScale

§

fn from_class(value: PyScale) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for ShiftType

§

const LABEL: &'static str = "a shift type"

§

const CLASS: &'static str = "ShiftType"

§

type Py = PyShiftType

§

fn from_class(value: PyShiftType) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for SigmaShape

§

const LABEL: &'static str = "a Hull-White sigma shape"

§

const CLASS: &'static str = "SigmaShape"

§

type Py = PySigmaShape

§

fn from_class(value: PySigmaShape) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for StrikeAxis

§

const LABEL: &'static str = "a strike axis"

§

const CLASS: &'static str = "StrikeAxis"

§

type Py = PyStrikeAxis

§

fn from_class(value: PyStrikeAxis) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for StripScheme

§

const LABEL: &'static str = "a strip scheme"

§

const CLASS: &'static str = "StripScheme"

§

type Py = PyStripScheme

§

fn from_class(value: PyStripScheme) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for SwaptionEngine

§

const LABEL: &'static str = "a swaption engine"

§

const CLASS: &'static str = "SwaptionEngine"

§

type Py = PySwaptionEngine

§

fn from_class(value: PySwaptionEngine) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for SwaptionKind

§

const LABEL: &'static str = "a swaption kind"

§

const CLASS: &'static str = "SwaptionKind"

§

type Py = PySwaptionKind

§

fn from_class(value: PySwaptionKind) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for SwaptionSettlement

§

const LABEL: &'static str = "a swaption settlement"

§

const CLASS: &'static str = "SwaptionSettlement"

§

type Py = PySwaptionSettlement

§

fn from_class(value: PySwaptionSettlement) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for VolConvention

§

const LABEL: &'static str = "a volatility convention"

§

const CLASS: &'static str = "VolConvention"

§

type Py = PyVolConvention

§

fn from_class(value: PyVolConvention) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

§

impl Crossing for YieldQuoteConvention

§

const LABEL: &'static str = "a yield convention"

§

const CLASS: &'static str = "YieldConvention"

§

type Py = PyYieldConvention

§

fn from_class(value: PyYieldConvention) -> PyResult<Self>

§

fn from_spelling(spelling: &str) -> PyResult<Self>

Implementors§