pub struct ReleaseDate { /* private fields */ }Expand description
A spec revision’s release date.
Ordered chronologically: the derived comparison walks year, then month,
then day, which is the only ordering in which those three fields compose
correctly. Nothing else may be derived from the ordering, so the Ord and
PartialOrd pair below comes from that same field order and
tests::derived_ordering_agrees_in_both_directions pins the two together.
Implementations§
Source§impl ReleaseDate
impl ReleaseDate
Sourcepub const V2024_11_05: Self
pub const V2024_11_05: Self
The first published revision, 2024-11-05.
Also the floor for ProtocolVersion::from_str: a well-formed date
before this one names a revision that predates the protocol, which is a
parse error rather than an unknown revision.
Sourcepub const V2025_03_26: Self
pub const V2025_03_26: Self
The 2025-03-26 revision.
Sourcepub const V2025_06_18: Self
pub const V2025_06_18: Self
The 2025-06-18 revision.
Sourcepub const V2025_11_25: Self
pub const V2025_11_25: Self
The 2025-11-25 revision.
Sourcepub const V2026_07_28: Self
pub const V2026_07_28: Self
The 2026-07-28 revision, and the newest this build knows.
Sourcepub fn is_at_or_after_first_revision(self) -> bool
pub fn is_at_or_after_first_revision(self) -> bool
Whether this date is ReleaseDate::V2024_11_05 or later.
The comparison is on the date, not the enum: a date this build has not heard of can still be after the first revision, and forward compatibility depends on that case being reachable.
Not const: the comparison comes from a derived Ord, and a derived
Ord is not a const-callable operator.
Trait Implementations§
Source§impl Clone for ReleaseDate
impl Clone for ReleaseDate
impl Copy for ReleaseDate
Source§impl Debug for ReleaseDate
impl Debug for ReleaseDate
Source§impl Display for ReleaseDate
impl Display for ReleaseDate
impl Eq for ReleaseDate
Source§impl FromStr for ReleaseDate
impl FromStr for ReleaseDate
Source§fn from_str(text: &str) -> Result<Self, Self::Err>
fn from_str(text: &str) -> Result<Self, Self::Err>
Parses exactly YYYY-MM-DD.
Every position is checked in order and the first failure is reported, so a string that is both the wrong length and unparseable says so once rather than producing a cascade. Trailing characters are rejected because a version string is a whole token, not a prefix of one.