Enum Locator
#[non_exhaustive]pub enum Locator {
Tenor(Period),
Date(NaiveDate),
Contract(String),
Window(WindowEnd, WindowEnd),
}Expand description
Where a quote sits on its curve, in the spellings a quote sheet uses: a
tenor (4Y), a date (2027-03-18), a contract code (SEP27), or a window
of two dates or two codes (2026-10-29 - 2026-12-10, SEP27 - DEC27, also
spelled with ..). The sheet binder and the helpers dispatch on its shape.
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.
Tenor(Period)
A tenor from the template’s start.
Date(NaiveDate)
An exact date.
Contract(String)
A futures contract code or YYYY-MM month.
Window(WindowEnd, WindowEnd)
A window from one end to the other.
Implementations§
§impl Locator
impl Locator
pub fn parse(spelling: &str) -> Result<Self, RungBuildError>
pub fn parse(spelling: &str) -> Result<Self, RungBuildError>
Parses a sheet spelling.
§Errors
RungBuildError::Contract when the spelling is none of the four shapes.
fn window_end(spelling: &str) -> Result<WindowEnd, RungBuildError>
Trait Implementations§
impl Eq for Locator
impl StructuralPartialEq for Locator
Auto Trait Implementations§
impl Freeze for Locator
impl RefUnwindSafe for Locator
impl Send for Locator
impl Sync for Locator
impl Unpin for Locator
impl UnsafeUnpin for Locator
impl UnwindSafe for Locator
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