pub struct KernelSnapshot {
pub turn: u32,
pub total_tokens: u64,
pub tasks: Vec<TcbSnapshot>,
pub context: ContextSnapshot,
pub run_spec: Option<String>,
}Expand description
Full kernel snapshot.
Fields§
§turn: u32§total_tokens: u64§tasks: Vec<TcbSnapshot>§context: ContextSnapshot§run_spec: Option<String>Implementations§
Source§impl KernelSnapshot
impl KernelSnapshot
Sourcepub fn from_state(
turn: u32,
total_tokens: u64,
tasks: &TaskTable,
context: &ContextSnapshot,
run_spec: Option<&AgentRunSpec>,
) -> Self
pub fn from_state( turn: u32, total_tokens: u64, tasks: &TaskTable, context: &ContextSnapshot, run_spec: Option<&AgentRunSpec>, ) -> Self
Create a snapshot from kernel state components.
Sourcepub fn run_spec(&self) -> Option<AgentRunSpec>
pub fn run_spec(&self) -> Option<AgentRunSpec>
Convert back to AgentRunSpec if present.
Sourcepub fn to_os_process_records(&self) -> Vec<ProcessRecord>
pub fn to_os_process_records(&self) -> Vec<ProcessRecord>
W2-2: Convert to OsSnapshot-compatible process records for verification with
rebuild_os_snapshot_from_events. This enables cross-validation between the
live state snapshot and the event-log-derived audit view.
Sourcepub fn restore_tcb(&self, snapshot: &TcbSnapshot) -> Option<Tcb>
pub fn restore_tcb(&self, snapshot: &TcbSnapshot) -> Option<Tcb>
W2-2: Restore TCB from snapshot. Returns None if the snapshot data is invalid.
Trait Implementations§
Source§impl Clone for KernelSnapshot
impl Clone for KernelSnapshot
Source§fn clone(&self) -> KernelSnapshot
fn clone(&self) -> KernelSnapshot
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 moreSource§impl Debug for KernelSnapshot
impl Debug for KernelSnapshot
Source§impl<'de> Deserialize<'de> for KernelSnapshot
impl<'de> Deserialize<'de> for KernelSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KernelSnapshot
impl RefUnwindSafe for KernelSnapshot
impl Send for KernelSnapshot
impl Sync for KernelSnapshot
impl Unpin for KernelSnapshot
impl UnsafeUnpin for KernelSnapshot
impl UnwindSafe for KernelSnapshot
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