pub struct EditionId {
pub family: &'static str,
pub year: u16,
pub month: u8,
pub version: u8,
}Expand description
The identifier of an edition, e.g. core2026.07.0.
The family names an independently versioned, additive group of encodings (core is the
set the default writer emits). The date components record when the edition was frozen and
order editions chronologically within a family; there is no ordering across families.
Fields§
§family: &'static strThe edition family, e.g. core.
year: u16Year the edition was cut.
month: u8Month the edition was cut.
version: u8Distinguishes editions cut in the same month; normally 0.
Implementations§
Source§impl EditionId
impl EditionId
Sourcepub const fn new(
family: &'static str,
year: u16,
month: u8,
version: u8,
) -> Self
pub const fn new( family: &'static str, year: u16, month: u8, version: u8, ) -> Self
Create an edition identifier. Validated by EditionId::validate, which
test_harness::validate_edition exercises
per edition in unit tests.
Sourcepub fn is_at_or_before(&self, other: &EditionId) -> bool
pub fn is_at_or_before(&self, other: &EditionId) -> bool
Returns true if self is the same edition as other or an earlier edition of the
same family. Editions of different families are never ordered.
Sourcepub fn validate(&self) -> Result<(), EditionError>
pub fn validate(&self) -> Result<(), EditionError>
Validate the identifier’s form: a non-empty lowercase family, a four-digit year,
and a month in 01-12. Checked for every declared edition by
EditionSession::validate and per edition by
test_harness::validate_edition.
Trait Implementations§
impl Copy for EditionId
impl Eq for EditionId
impl StructuralPartialEq for EditionId
Auto Trait Implementations§
impl Freeze for EditionId
impl RefUnwindSafe for EditionId
impl Send for EditionId
impl Sync for EditionId
impl Unpin for EditionId
impl UnsafeUnpin for EditionId
impl UnwindSafe for EditionId
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.