Struct PyPreset
pub struct PyPreset {
pub(crate) preset: Preset,
pub(crate) request: Request,
}Expand description
A named risk measure — DV01, PAR_LADDER, CS01 — as a report is asked
for it: the point it names and the scale it reports in.
Fields§
§preset: Preset§request: RequestImplementations§
§impl PyPreset
impl PyPreset
fn asset_class(&self) -> Option<String>
fn asset_class(&self) -> Option<String>
The asset class it is filed under — rates, credit, fx,
inflation — or None for NPV.
fn default_scale(&self) -> String
fn default_scale(&self) -> String
The scale it reports in by default, when nothing else states one.
fn per(&self, scale: Named<Scale>) -> Self
fn per(&self, scale: Named<Scale>) -> Self
This preset restated at scale — a Scale, or unit, bp, pct,
volpt or x<factor>. It keeps its name; the report’s scale column
says which.
fn __str__(&self) -> &'static str
fn __repr__(&self) -> String
Trait Implementations§
impl DerefToPyAny for PyPreset
impl Eq for PyPreset
§impl PyClassImpl for PyPreset
impl PyClassImpl for PyPreset
§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<PyPreset>
type ThreadChecker = SendablePyClass<PyPreset>
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<PyPreset> for PyClassImplCollector<PyPreset>
impl PyMethods<PyPreset> for PyClassImplCollector<PyPreset>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyPreset
impl PyTypeInfo for PyPreset
§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.impl StructuralPartialEq for PyPreset
Auto Trait Implementations§
impl Freeze for PyPreset
impl RefUnwindSafe for PyPreset
impl Send for PyPreset
impl Sync for PyPreset
impl Unpin for PyPreset
impl UnsafeUnpin for PyPreset
impl UnwindSafe for PyPreset
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