pub struct SessionSnapshotV1 {
pub schema_version: u32,
pub session: SessionData,
pub artifacts: Vec<ToolArtifact>,
pub trace_events: Vec<TraceEvent>,
pub run_records: Vec<RunRecord>,
pub verification_reports: Vec<VerificationReport>,
pub subagent_tasks: Vec<SubagentTaskSnapshot>,
}Expand description
A complete, versioned persistence generation for one session.
Stores commit this value as a unit so conversation state and its related runtime records cannot be observed from different save generations.
Fields§
§schema_version: u32§session: SessionData§artifacts: Vec<ToolArtifact>§trace_events: Vec<TraceEvent>§run_records: Vec<RunRecord>§verification_reports: Vec<VerificationReport>§subagent_tasks: Vec<SubagentTaskSnapshot>Implementations§
Source§impl SessionSnapshotV1
impl SessionSnapshotV1
pub fn new( session: SessionData, artifacts: &ArtifactStore, trace_events: Vec<TraceEvent>, run_records: Vec<RunRecord>, verification_reports: Vec<VerificationReport>, subagent_tasks: Vec<SubagentTaskSnapshot>, ) -> Self
pub fn session_only(session: SessionData) -> Self
Sourcepub fn fork_for_session(
self,
session_id: impl Into<String>,
workspace: impl Into<String>,
) -> Result<Self>
pub fn fork_for_session( self, session_id: impl Into<String>, workspace: impl Into<String>, ) -> Result<Self>
Rebind a complete snapshot to a new session and workspace.
Session forks retain historical artifacts, traces, run ids, and child session ids. Top-level run ownership and subagent parent ownership must move with the new session or the aggregate would no longer be loadable.
pub fn artifact_store(&self) -> ArtifactStore
pub fn ensure_loadable(&self) -> Result<()>
Sourcepub fn validate_invariants(&self) -> Result<()>
pub fn validate_invariants(&self) -> Result<()>
Validate relationships that must hold within one persisted generation.
Event buffers may be FIFO-trimmed, so their first sequence is allowed
to be greater than zero and event_count is allowed to exceed the
retained length. It must, however, remain a valid next-sequence cursor
for every retained event.
Sourcepub fn validate_for_session(&self, session_id: &str) -> Result<()>
pub fn validate_for_session(&self, session_id: &str) -> Result<()>
Validate this snapshot for a load request targeting session_id.
Trait Implementations§
Source§impl Clone for SessionSnapshotV1
impl Clone for SessionSnapshotV1
Source§fn clone(&self) -> SessionSnapshotV1
fn clone(&self) -> SessionSnapshotV1
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionSnapshotV1
impl Debug for SessionSnapshotV1
Source§impl<'de> Deserialize<'de> for SessionSnapshotV1
impl<'de> Deserialize<'de> for SessionSnapshotV1
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>,
Auto Trait Implementations§
impl !RefUnwindSafe for SessionSnapshotV1
impl !UnwindSafe for SessionSnapshotV1
impl Freeze for SessionSnapshotV1
impl Send for SessionSnapshotV1
impl Sync for SessionSnapshotV1
impl Unpin for SessionSnapshotV1
impl UnsafeUnpin for SessionSnapshotV1
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more