pub struct StateSnapshot { /* private fields */ }Expand description
Opaque llama.cpp causal state with compatibility-bound identity metadata.
Implementations§
Source§impl StateSnapshot
impl StateSnapshot
Sourcepub fn from_parts(
bytes: Vec<u8>,
tokens: Vec<TokenId>,
receipt: CheckpointReceipt,
) -> Result<StateSnapshot, Error>
pub fn from_parts( bytes: Vec<u8>, tokens: Vec<TokenId>, receipt: CheckpointReceipt, ) -> Result<StateSnapshot, Error>
Reconstructs a checkpoint from caller-owned storage.
This validates internal byte count, state identity, token lineage, and
position. Session::restore_state separately verifies the model,
backend build, and session allocation identities before passing bytes to
llama.cpp.
§Errors
Returns an error for empty state bytes or inconsistent metadata.
Sourcepub fn bytes(&self) -> &[u8] ⓘ
pub fn bytes(&self) -> &[u8] ⓘ
Returns opaque native state bytes covered by the checkpoint receipt.
Sourcepub const fn receipt(&self) -> &CheckpointReceipt
pub const fn receipt(&self) -> &CheckpointReceipt
Returns serializable, compatibility-bound checkpoint metadata.
Sourcepub fn into_parts(self) -> (Vec<u8>, Vec<TokenId>, CheckpointReceipt)
pub fn into_parts(self) -> (Vec<u8>, Vec<TokenId>, CheckpointReceipt)
Returns all caller-owned parts for application-defined persistence.
Trait Implementations§
Source§impl Clone for StateSnapshot
impl Clone for StateSnapshot
Source§fn clone(&self) -> StateSnapshot
fn clone(&self) -> StateSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StateSnapshot
impl RefUnwindSafe for StateSnapshot
impl Send for StateSnapshot
impl Sync for StateSnapshot
impl Unpin for StateSnapshot
impl UnsafeUnpin for StateSnapshot
impl UnwindSafe for StateSnapshot
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
Mutably borrows from an owned value. Read more