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) -> VortexResult<()>
pub fn declare(&self, declaration: &EditionDeclaration) -> VortexResult<()>
Declare an edition together with the members added at it. Each entry’s membership
(since) is the declared edition; earlier entries are inherited and must not be restated.
Sourcepub fn declare_family(&self, family: &EditionFamily) -> VortexResult<()>
pub fn declare_family(&self, family: &EditionFamily) -> VortexResult<()>
Declare an edition family. Errors if a family with the same name is already
declared. Every family must be declared before EditionSession::validate will
accept editions belonging to it.
Sourcepub fn families(&self) -> Vec<EditionFamily>
pub fn families(&self) -> Vec<EditionFamily>
All declared families, sorted by name.
Sourcepub fn find_family(&self, name: &str) -> Option<EditionFamily>
pub fn find_family(&self, name: &str) -> Option<EditionFamily>
Find a declared family by name.
Sourcepub fn declare_edition(&self, edition: Edition) -> VortexResult<()>
pub fn declare_edition(&self, edition: Edition) -> VortexResult<()>
Declare an edition. Errors if an edition with the same id is already declared.
Sourcepub fn declare_inclusion(&self, inclusion: EditionInclusion) -> VortexResult<()>
pub fn declare_inclusion(&self, inclusion: EditionInclusion) -> VortexResult<()>
Declare an edition inclusion. A component may belong to multiple families but joins each family only once. A newer wire representation uses a new component ID. 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, sorted by component id. For each id, this returns its inclusion in the edition’s family when it joined at or before the requested edition. Only that kind’s declarations are scanned.
Sourcepub fn validate(&self) -> VortexResult<()>
pub fn validate(&self) -> VortexResult<()>
Validate all registered declarations. Errors on editions in undeclared families, 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