Skip to main content

EditionSession

Struct EditionSession 

Source
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

Source

pub fn empty() -> Self

Create a session variable with no declarations.

Source

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.

Source

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.

Source

pub fn families(&self) -> Vec<EditionFamily>

All declared families, sorted by name.

Source

pub fn find_family(&self, name: &str) -> Option<EditionFamily>

Find a declared family by name.

Source

pub fn declare_edition(&self, edition: Edition) -> VortexResult<()>

Declare an edition. Errors if an edition with the same id is already declared.

Source

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.

Source

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.

Source

pub fn find(&self, id: &EditionId) -> Option<Edition>

Find a declared edition by id.

Source

pub fn current(&self, family: &str) -> Option<Edition>

The newest frozen edition of a family, if any. Drafts are never current.

Source

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.

Source

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

Source§

fn clone(&self) -> EditionSession

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EditionSession

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EditionSession

Source§

fn default() -> EditionSession

Returns the “default value” for a type. Read more
Source§

impl SessionVar for EditionSession

Source§

fn as_any(&self) -> &dyn Any

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V> VortexSessionVar for V
where V: SessionVar + Clone,