pub struct SeqState { /* private fields */ }Expand description
Opaque, immutable snapshot of a single sequence’s state.
Produced by LlamaContext::state_seq_get and consumed by
LlamaContext::state_seq_set. Bytes cannot be constructed, forged,
or mutated from safe code — the only way to obtain a SeqState is
via a get call, which guarantees the payload came from llama.cpp
itself. Combined with llama.cpp’s own shape validation on the
deserialize path, this closes the “arbitrary bytes into C parser”
unsoundness that motivates the unsafe raw setters.
The state carries the flag set it was captured with; restore uses those same flags automatically so the byte layout always matches.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SeqState
impl RefUnwindSafe for SeqState
impl Send for SeqState
impl Sync for SeqState
impl Unpin for SeqState
impl UnsafeUnpin for SeqState
impl UnwindSafe for SeqState
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