pub struct EditionSession { /* private fields */ }Expand description
The session’s registry of editions and edition inclusions.
Starts empty and is populated at initialization time: the vortex facade seeds the
first-party declarations (vortex::editions), and crates registering additional
encodings declare their inclusions (and, for new families, editions) alongside their
encoding registration. Clones share the same underlying registry, matching the other
session registries.
Implementations§
Source§impl EditionSession
impl EditionSession
Sourcepub fn declare(
&self,
declaration: &EditionDeclaration,
) -> Result<(), EditionError>
pub fn declare( &self, declaration: &EditionDeclaration, ) -> Result<(), EditionError>
Declare an edition together with the encodings that join the family at it. Each
added encoding’s membership (since) is the declared edition; members of earlier
editions are inherited and must not be restated.
Sourcepub fn declare_edition(&self, edition: Edition) -> Result<(), EditionError>
pub fn declare_edition(&self, edition: Edition) -> Result<(), EditionError>
Declare an edition. Errors if an edition with the same id is already declared.
Sourcepub fn declare_inclusion(
&self,
inclusion: EditionInclusion,
) -> Result<(), EditionError>
pub fn declare_inclusion( &self, inclusion: EditionInclusion, ) -> Result<(), EditionError>
Declare an edition inclusion. Errors if the encoding already has one: an encoding belongs to exactly one family, with one membership interval.
Sourcepub fn editions(&self) -> Vec<Edition>
pub fn editions(&self) -> Vec<Edition>
All declared editions, sorted by family and then chronologically. The newest frozen
edition of each family is that family’s current edition; unversioned editions are
drafts.
Sourcepub fn current(&self, family: &str) -> Option<Edition>
pub fn current(&self, family: &str) -> Option<Edition>
The newest frozen edition of a family, if any. Drafts are never current.
Sourcepub fn encodings_in(&self, edition: &EditionId) -> Vec<EditionInclusion>
pub fn encodings_in(&self, edition: &EditionId) -> Vec<EditionInclusion>
Compute the full encoding set of an edition: every declared inclusion of the
edition’s family whose since is at or before it, sorted by encoding id.
Sourcepub fn validate(&self) -> Result<(), EditionError>
pub fn validate(&self) -> Result<(), EditionError>
Validate all registered declarations. Errors on inclusions referencing undeclared editions, editions out of chronological order within a family (unversioned drafts must be newest), malformed version strings, and members requiring a release newer than their edition declares.
Trait Implementations§
Source§impl Clone for EditionSession
impl Clone for EditionSession
Source§fn clone(&self) -> EditionSession
fn clone(&self) -> EditionSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more