Skip to main content

StateLayout

Struct StateLayout 

Source
pub struct StateLayout { /* private fields */ }
Expand description

Complete ordered mutable-state geometry owned by one model instance.

Implementations§

Source§

impl StateLayout

Source

pub fn new(layers: LayerSchedule<LayerCachePolicy>) -> Result<Self, StateError>

Creates and validates a simple ordered layout with one persistent segment named DEFAULT_STATE_SEGMENT_ID.

Source

pub fn segmented( layers: LayerSchedule<LayerCachePolicy>, segments: impl IntoIterator<Item = StateSegmentSpec>, ) -> Result<Self, StateError>

Creates an ordered layout partitioned into named contiguous segments.

Segment declarations are sorted into layer order and must form an exact, non-overlapping partition of every state-bearing layer. Stable segment identity and lifetime therefore participate in layout equality and runtime-state compatibility checks.

Source

pub fn len(&self) -> usize

Returns the number of architecture-global layers represented here.

Source

pub fn logical_metadata_bytes(&self) -> Option<u64>

Logical host storage copied with this complete layout, including nested component shapes and segment names. Allocator capacity/overhead is excluded. None means checked size arithmetic overflowed, never zero storage.

Source

pub fn is_empty(&self) -> bool

Returns whether this layout has no layers.

Source

pub fn layer(&self, layer: usize) -> Option<&LayerCachePolicy>

Returns one layer’s exact state policy.

Source

pub const fn layers(&self) -> &LayerSchedule<LayerCachePolicy>

Borrows the portable ordered layer schedule.

Source

pub fn components(&self, layer: usize) -> Option<&[StateComponentPolicy]>

Returns ordered named semantic components for one layer.

Source

pub fn segments(&self) -> &[StateSegmentSpec]

Returns named state segments in deterministic layer order.

Source

pub fn segment(&self, id: &StateSegmentId) -> Option<&StateSegmentSpec>

Resolves one named state segment.

Source

pub fn segment_for_layer(&self, layer: usize) -> Option<&StateSegmentSpec>

Resolves the unique named segment containing one state layer.

Source

pub fn layer_prefix_offsets(&self) -> Vec<i32>

Expands architecture-declared segment frontiers into layer order.

Source

pub fn slice(&self, layers: Range<usize>) -> Result<Self, StateError>

Selects a contiguous architecture-global range while preserving the intersecting segment identities, lifetimes, and token frontiers.

Trait Implementations§

Source§

impl Clone for StateLayout

Source§

fn clone(&self) -> StateLayout

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 StateLayout

Source§

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

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

impl Eq for StateLayout

Source§

impl PartialEq for StateLayout

Source§

fn eq(&self, other: &StateLayout) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StateLayout

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> Same for T

Source§

type Output = T

Should always be Self
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.