Struct ForwardTenor
pub struct ForwardTenor {
pub forward_start: Option<Period>,
pub tenor: Period,
}Expand description
A tenor with an optional forward start: "5Y" is a five-year term from
spot, and "2Y2Y" is a two-year term starting two years after spot — the
<forward-start><tenor> spelling a forward swap or a swaption is quoted in.
This is the one parser for the two-segment spelling. The swap builder’s
tenor form reads it, and a swaption’s expiry is its forward start, so no
builder splits the segments for itself. A Period is one segment; the
FRA’s forward start is a bare Period because its term comes from the
index rather than the spelling.
Two forward tenors are equal when both segments are, under Period’s
semantic equality (24M2Y == 2Y2Y).
Fields§
§forward_start: Option<Period>How far after spot the term starts; None for a term from spot.
tenor: PeriodThe term’s length.
Implementations§
Trait Implementations§
§impl Clone for ForwardTenor
impl Clone for ForwardTenor
§fn clone(&self) -> ForwardTenor
fn clone(&self) -> ForwardTenor
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 ForwardTenor
§impl Debug for ForwardTenor
impl Debug for ForwardTenor
§impl Display for ForwardTenor
impl Display for ForwardTenor
impl Eq for ForwardTenor
§impl From<ForwardTenor> for Termination
impl From<ForwardTenor> for Termination
§fn from(tenor: ForwardTenor) -> Self
fn from(tenor: ForwardTenor) -> Self
§impl FromStr for ForwardTenor
impl FromStr for ForwardTenor
§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses one or two period segments, each a count and a unit letter, in
either case: "5Y", "2y2y", "6M5Y". A segment ends at its unit
letter, so the split needs no separator. Three or more segments, an
empty spelling, or a segment that is not a period are refused naming
the form.