pub struct StateLayout { /* private fields */ }Expand description
Complete ordered mutable-state geometry owned by one model instance.
Implementations§
Source§impl StateLayout
impl StateLayout
Sourcepub fn new(layers: LayerSchedule<LayerCachePolicy>) -> Result<Self, StateError>
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.
Sourcepub fn segmented(
layers: LayerSchedule<LayerCachePolicy>,
segments: impl IntoIterator<Item = StateSegmentSpec>,
) -> Result<Self, StateError>
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.
Sourcepub fn logical_metadata_bytes(&self) -> Option<u64>
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.
Sourcepub fn layer(&self, layer: usize) -> Option<&LayerCachePolicy>
pub fn layer(&self, layer: usize) -> Option<&LayerCachePolicy>
Returns one layer’s exact state policy.
Sourcepub const fn layers(&self) -> &LayerSchedule<LayerCachePolicy>
pub const fn layers(&self) -> &LayerSchedule<LayerCachePolicy>
Borrows the portable ordered layer schedule.
Sourcepub fn components(&self, layer: usize) -> Option<&[StateComponentPolicy]>
pub fn components(&self, layer: usize) -> Option<&[StateComponentPolicy]>
Returns ordered named semantic components for one layer.
Sourcepub fn segments(&self) -> &[StateSegmentSpec]
pub fn segments(&self) -> &[StateSegmentSpec]
Returns named state segments in deterministic layer order.
Sourcepub fn segment(&self, id: &StateSegmentId) -> Option<&StateSegmentSpec>
pub fn segment(&self, id: &StateSegmentId) -> Option<&StateSegmentSpec>
Resolves one named state segment.
Sourcepub fn segment_for_layer(&self, layer: usize) -> Option<&StateSegmentSpec>
pub fn segment_for_layer(&self, layer: usize) -> Option<&StateSegmentSpec>
Resolves the unique named segment containing one state layer.
Sourcepub fn layer_prefix_offsets(&self) -> Vec<i32>
pub fn layer_prefix_offsets(&self) -> Vec<i32>
Expands architecture-declared segment frontiers into layer order.
Trait Implementations§
Source§impl Clone for StateLayout
impl Clone for StateLayout
Source§fn clone(&self) -> StateLayout
fn clone(&self) -> StateLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more