pub trait ReplicatedTextSnapshotMechanisms<A, B>: ReplicatedTextSessionMechanisms<A, B>where
B: SubmissionBackend<Executor = <<B as NeuralBackend>::Tensor as Tensor>::Context>,
A: LayeredArchitecture<B, Self::State>,
Self::State: RuntimeState<B>,
Self::ResidentPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>,
Self::BoundedPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>,{
// Required methods
fn estimate_snapshot_state(
&self,
state: &Self::State,
) -> Option<SnapshotEstimate>;
fn copy_snapshot_state(
&mut self,
state: &Self::State,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<Self::State, Self::Error>;
// Provided method
fn estimate_snapshot_growth(
&self,
_state: &Self::State,
_additional_input_tokens: u64,
) -> Option<u64> { ... }
}Expand description
Native mechanisms for complete, independently writable ordinary state copies. Unlike rollback checkpoints, these copies must remain stable as any descendant advances. Estimation is side-effect-free; completion stays with the existing backend submission owner, not this portable driver.
Required Methods§
Sourcefn estimate_snapshot_state(
&self,
state: &Self::State,
) -> Option<SnapshotEstimate>
fn estimate_snapshot_state( &self, state: &Self::State, ) -> Option<SnapshotEstimate>
Known logical cost for copying the exact state. None explicitly means unknown/unsupported; callers must reserve a known estimate before copying.
Sourcefn copy_snapshot_state(
&mut self,
state: &Self::State,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<Self::State, Self::Error>
fn copy_snapshot_state( &mut self, state: &Self::State, context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, ) -> Result<Self::State, Self::Error>
Copies every native state component, preserving geometry and positions. Mutable storage must be isolated. On error the source remains unchanged; all unresolved native resources stay with the existing recovery owner.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".