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 components that join the family at it. Each
added member’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 component already has one: a component belongs to exactly one family, with one membership interval. Kind is part of the key, so an array encoding and a layout may share an id.
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 components_in(
&self,
edition: &EditionId,
kind: ComponentKind,
) -> Vec<EditionInclusion>
pub fn components_in( &self, edition: &EditionId, kind: ComponentKind, ) -> Vec<EditionInclusion>
Compute an edition’s members of one kind: every declared inclusion of that kind in
the edition’s family whose since is at or before it, sorted by component id. Only
that kind’s declarations are scanned.
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