Skip to main content

SessionHistoryIntegration

Struct SessionHistoryIntegration 

Source
pub struct SessionHistoryIntegration;
Expand description

Narrow integration surface used by the kcode-session-history facade.

Ordinary callers should create and reopen sessions through kcode_session_history::SessionHistory. Keeping construction and raw-log replay here lets that facade retain sole ownership of session lifecycle while this crate owns Chatend’s mechanical persistence and projection.

Implementations§

Source§

impl SessionHistoryIntegration

Source

pub fn create_session( path: impl AsRef<Path>, metadata: SessionMetadata, ) -> Result<Session>

Creates a durable Chatend session for the history facade.

Source

pub fn open_session( path: impl AsRef<Path>, metadata: SessionMetadata, default_provider_model: Option<&str>, estimator: Option<ProviderCostEstimator>, ) -> Result<Session>

Reopens a durable Chatend session for the history facade.

When estimator is present, historical provider receipts that predate stored cost fields are projected using default_provider_model and the supplied estimator without rewriting durable history.

Source

pub fn replay( metadata: SessionMetadata, log: &SessionLog, default_provider_model: Option<&str>, estimator: Option<ProviderCostEstimator>, ) -> Result<Chatend>

Replays a raw session log into exact Chatend state for presentation.

Optional compatibility pricing affects only the returned projection and never mutates the supplied log.

Source

pub fn legacy_provider_cost_summary_for_archive( archive: &Value, default_provider_model: Option<&str>, estimator: ProviderCostEstimator, ) -> Result<ProviderCostSummary>

Reconstructs compatible cost fields from an immutable session archive.

The archive is not modified.

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> 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, 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.