Struct VendorCalcMethod
pub struct VendorCalcMethod {
pub code: u16,
pub name: &'static str,
pub conventions: CalcConventions,
pub applies_to: BondKind,
pub status: ConventionStatus,
}Expand description
A resolved vendor calc-type: the code, its DES label, and the bundle.
Fields§
§code: u16The vendor DES calc-type code (e.g. 368).
name: &'static strThe DES label (e.g. "S AFRICA EX-DIV BD").
conventions: CalcConventionsThe conventions the code books with.
applies_to: BondKindThe instrument kind the code applies to; materialisers reject a static
of the other kind with CalcMethodError::KindMismatch.
status: ConventionStatusWhether the convention is fully pinned, or which part is pending.
Implementations§
§impl VendorCalcMethod
impl VendorCalcMethod
pub fn from_code(code: u16) -> Result<VendorCalcMethod, CalcMethodError>
pub fn from_code(code: u16) -> Result<VendorCalcMethod, CalcMethodError>
Resolves a vendor calc-type code, failing loud on unknown codes.
§Errors
CalcMethodError carrying code when the table has no entry for it.
Unknown codes fail loud rather than falling back to the street
convention, because a silently defaulted calc method reprices a bond
without saying so.
fn status_of(code: u16) -> ConventionStatus
fn status_of(code: u16) -> ConventionStatus
The status of code’s convention: pending where the table names it.
pub fn pending() -> &'static [(u16, &'static str)]
pub fn pending() -> &'static [(u16, &'static str)]
Every code whose convention is partly pending a vendor screen pin, with what is outstanding, in ascending code order.
pub fn codes() -> Vec<u16>
pub fn codes() -> Vec<u16>
Every code the registry resolves, ascending — read off
from_code across the whole code range, so no
second list can drift from the table.
pub fn registry() -> Vec<VendorCalcMethod>
pub fn registry() -> Vec<VendorCalcMethod>
Every method the registry holds, in code order.
Trait Implementations§
§impl Clone for VendorCalcMethod
impl Clone for VendorCalcMethod
§fn clone(&self) -> VendorCalcMethod
fn clone(&self) -> VendorCalcMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VendorCalcMethod
§impl Debug for VendorCalcMethod
impl Debug for VendorCalcMethod
§impl PartialEq for VendorCalcMethod
impl PartialEq for VendorCalcMethod
§fn eq(&self, other: &VendorCalcMethod) -> bool
fn eq(&self, other: &VendorCalcMethod) -> bool
self and other values to be equal, and is used by ==.