pub struct BasisArchive { /* private fields */ }Expand description
Portable, versioned manifest of ordered physical basis states.
A basis archive stores stable state identifiers, their logical bit width, public row ordering, and scalar metadata. It intentionally does not serialize executable callbacks. Built-in frontends may store their language-neutral constructor request in metadata and rebuild local operator semantics after loading, while every consumer can use the state manifest to align vectors, projectors, and operator archives safely.
Implementations§
Source§impl BasisArchive
impl BasisArchive
Sourcepub fn new(
width_bits: usize,
states: impl IntoIterator<Item = ErasedState>,
) -> Result<Self>
pub fn new( width_bits: usize, states: impl IntoIterator<Item = ErasedState>, ) -> Result<Self>
Construct an archive from ordered, unique physical state identifiers.
Sourcepub fn from_basis<B>(basis: &B, width_bits: usize) -> Result<Self>
pub fn from_basis<B>(basis: &B, width_bits: usize) -> Result<Self>
Snapshot any integer-labelled basis without changing its public order.
Sourcepub const fn width_bits(&self) -> usize
pub const fn width_bits(&self) -> usize
Logical bit width of every archived state.
Sourcepub fn states(&self) -> &[ErasedState]
pub fn states(&self) -> &[ErasedState]
Ordered physical states, one per public basis row.
Sourcepub fn insert_metadata(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
) -> Result<()>
pub fn insert_metadata( &mut self, key: impl Into<String>, value: impl Into<String>, ) -> Result<()>
Attach a small language-neutral reconstruction hint or provenance item.
Sourcepub fn metadata(&self) -> impl Iterator<Item = (&str, &str)>
pub fn metadata(&self) -> impl Iterator<Item = (&str, &str)>
Iterate over archived scalar metadata.
Sourcepub fn metadata_value(&self, key: &str) -> Option<&str>
pub fn metadata_value(&self, key: &str) -> Option<&str>
Read one archived metadata value.
Trait Implementations§
Source§impl Clone for BasisArchive
impl Clone for BasisArchive
Source§fn clone(&self) -> BasisArchive
fn clone(&self) -> BasisArchive
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BasisArchive
impl RefUnwindSafe for BasisArchive
impl Send for BasisArchive
impl Sync for BasisArchive
impl Unpin for BasisArchive
impl UnsafeUnpin for BasisArchive
impl UnwindSafe for BasisArchive
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.