Skip to main content

DurableSession

Struct DurableSession 

Source
pub struct DurableSession { /* private fields */ }
Expand description

A UUID-backed durable session bound to an opaque host external ID.

Implementations§

Source§

impl DurableSession

Source

pub fn id(&self) -> Uuid

Returns Talos’s UUID identity used for the safe TLOG filename.

Source

pub fn external_id(&self) -> &str

Returns the host-provided logical key; it is never used as a filename.

Source

pub fn file_path(&self) -> &Path

Returns the UUID-named TLOG path under the host-selected directory.

Source

pub fn read_messages(&self) -> Result<Vec<Message>, SessionError>

Returns model messages suitable for automatic Runtime history recovery.

Source

pub fn session(&self) -> &Session

Returns the underlying session for read-only inspection.

Source

pub fn capabilities(&self) -> SessionCapabilities

Returns durable format capabilities without inferring support from extensions.

Source

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.

Source

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.

Source

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.

Source

pub fn abort_turn( &self, turn_id: &str, _reason: &str, ) -> Result<(), SessionError>

Marks an uncommitted turn as aborted. No transcript state is written.

Source

pub fn delete(self) -> Result<(), SessionError>

Deletes the TLOG and its external-ID binding.

Source§

impl DurableSession

Source

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

Source§

fn clone(&self) -> DurableSession

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DurableSession

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.