pub struct DurableSession { /* private fields */ }Expand description
A UUID-backed durable session bound to an opaque host external ID.
Implementations§
Source§impl DurableSession
impl DurableSession
Sourcepub fn external_id(&self) -> &str
pub fn external_id(&self) -> &str
Returns the host-provided logical key; it is never used as a filename.
Sourcepub fn file_path(&self) -> &Path
pub fn file_path(&self) -> &Path
Returns the UUID-named TLOG path under the host-selected directory.
Sourcepub fn read_messages(&self) -> Result<Vec<Message>, SessionError>
pub fn read_messages(&self) -> Result<Vec<Message>, SessionError>
Returns model messages suitable for automatic Runtime history recovery.
Sourcepub fn capabilities(&self) -> SessionCapabilities
pub fn capabilities(&self) -> SessionCapabilities
Returns durable format capabilities without inferring support from extensions.
Sourcepub fn transcript(
&self,
cursor: Option<&str>,
limit: usize,
) -> Result<Vec<DurableTranscriptEntry>, SessionError>
pub fn transcript( &self, cursor: Option<&str>, limit: usize, ) -> Result<Vec<DurableTranscriptEntry>, SessionError>
Returns a normalized transcript page after an optional entry-ID cursor.
The cursor entry is excluded. The method exposes no raw TLOG lines,
provider payloads, HTTP headers, raw_content metadata, or hidden
terminal outcome markers.
Sourcepub fn commit_turn(
&self,
turn_id: &str,
messages: &[Message],
policy: &PersistencePolicy,
) -> Result<TurnCommit, SessionError>
pub fn commit_turn( &self, turn_id: &str, messages: &[Message], policy: &PersistencePolicy, ) -> Result<TurnCommit, SessionError>
Atomically commits every model-visible message and the hidden Success marker of one completed turn.
Repeating a committed turn_id returns the original model-visible IDs
without writing duplicates. The outcome marker is written in the same
atomic replacement as the messages so startup can distinguish a proven
Success from partial or ambiguous transcript state.
Sourcepub fn finalize_turn(
&self,
turn_id: &str,
messages: &[Message],
policy: &PersistencePolicy,
outcome: TurnTranscriptOutcome,
) -> Result<TurnCommit, SessionError>
pub fn finalize_turn( &self, turn_id: &str, messages: &[Message], policy: &PersistencePolicy, outcome: TurnTranscriptOutcome, ) -> Result<TurnCommit, SessionError>
Atomically finalizes one turn with its admitted display-safe prefix.
The first terminal outcome wins. Retrying the same outcome with the same filtered role/content sequence returns the original entry IDs without a write. A conflicting outcome or payload is rejected without mutation.
Sourcepub fn abort_turn(
&self,
turn_id: &str,
_reason: &str,
) -> Result<(), SessionError>
pub fn abort_turn( &self, turn_id: &str, _reason: &str, ) -> Result<(), SessionError>
Marks an uncommitted turn as aborted. No transcript state is written.
Sourcepub fn delete(self) -> Result<(), SessionError>
pub fn delete(self) -> Result<(), SessionError>
Deletes the TLOG and its external-ID binding.
Source§impl DurableSession
impl DurableSession
Sourcepub fn committed_turn_entry_ids(
&self,
turn_id: &str,
) -> Result<Vec<String>, SessionError>
pub fn committed_turn_entry_ids( &self, turn_id: &str, ) -> Result<Vec<String>, SessionError>
Returns transcript evidence associated with one Turn.
Model-visible entry IDs are returned when present. A hidden terminal outcome marker contributes one synthetic evidence token so the Actor’s existing startup path invokes the journal classifier even for an Error, Cancelled, or empty successful Turn. The pending journal then maps the authoritative outcome to Committed, TerminalError, or TerminalCancelled. No message or outcome evidence returns an empty vector and remains frozen.
Trait Implementations§
Source§impl Clone for DurableSession
impl Clone for DurableSession
Source§fn clone(&self) -> DurableSession
fn clone(&self) -> DurableSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more