Enum ProjectionKey
#[non_exhaustive]pub enum ProjectionKey {
Typed(String),
Resolved(String),
}Expand description
What a projection curve may be keyed under.
A projection key is a string in the rate-index namespace. It reaches
MarketContext::with_projection_checked two ways, and they warrant different
treatment:
- A code a caller typed is where a typo enters. It is checked against the registry, and an unknown one is refused naming the registered set.
- An index value has already established what it is. There is no typo to catch, so it is taken at its word and keyed under the name a leg on that index would carry. This is what lets a caller pin a curve for an index they built rather than resolved, without registering it first.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Typed(String)
A string naming an index, to be checked against the registry.
Resolved(String)
The key of an index that is already in hand.
Implementations§
§impl ProjectionKey
impl ProjectionKey
Trait Implementations§
§impl Clone for ProjectionKey
impl Clone for ProjectionKey
§fn clone(&self) -> ProjectionKey
fn clone(&self) -> ProjectionKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ProjectionKey
impl Debug for ProjectionKey
impl Eq for ProjectionKey
§impl From<&AnyIndex> for ProjectionKey
impl From<&AnyIndex> for ProjectionKey
§impl From<&IborIndex> for ProjectionKey
impl From<&IborIndex> for ProjectionKey
§impl From<&OvernightIndex> for ProjectionKey
impl From<&OvernightIndex> for ProjectionKey
§fn from(i: &OvernightIndex) -> Self
fn from(i: &OvernightIndex) -> Self
Converts to this type from the input type.
§impl From<&str> for ProjectionKey
impl From<&str> for ProjectionKey
§impl From<String> for ProjectionKey
impl From<String> for ProjectionKey
§impl PartialEq for ProjectionKey
impl PartialEq for ProjectionKey
impl StructuralPartialEq for ProjectionKey
Auto Trait Implementations§
impl Freeze for ProjectionKey
impl RefUnwindSafe for ProjectionKey
impl Send for ProjectionKey
impl Sync for ProjectionKey
impl Unpin for ProjectionKey
impl UnsafeUnpin for ProjectionKey
impl UnwindSafe for ProjectionKey
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