Skip to main content

RuntimeStore

Struct RuntimeStore 

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

Runtime store facade composing session, execution, run, embedding, and artifact stores.

Provides a unified interface for all runtime persistence operations. Individual sub-stores are accessed via their respective accessor methods.

Implementations§

Source§

impl RuntimeStore

Source

pub fn new( sessions: Box<dyn SessionStore>, executions: Box<dyn ExecutionStore>, runs: Box<dyn RunStore>, ) -> Self

Creates a new runtime store with session, execution, and run stores.

Embedding and artifact stores are optional — attach them with with_embeddings and with_artifacts.

Source

pub fn with_embeddings(self, store: Box<dyn EmbeddingStore>) -> Self

Attaches an optional embedding store for vector search operations.

Source

pub fn with_artifacts(self, store: Box<dyn ArtifactStore>) -> Self

Attaches an optional artifact store for file/blob storage.

Source

pub fn sessions(&self) -> &dyn SessionStore

Returns the session store.

Source

pub fn executions(&self) -> &dyn ExecutionStore

Returns the execution store.

Source

pub fn runs(&self) -> &dyn RunStore

Returns the run store.

Source

pub fn embeddings(&self) -> Option<&dyn EmbeddingStore>

Returns the embedding store, if configured.

Source

pub fn artifacts(&self) -> Option<&dyn ArtifactStore>

Returns the artifact store, if configured.

Source

pub fn from_extensions(exts: &Extensions) -> Self

Creates a RuntimeStore from an Extensions facade, cloning its store extension points. Backed by default in-memory stores when no entries are registered.

Source

pub fn sessions_ep(&self) -> &ExtensionPoint<dyn SessionStore>

Returns the session store extension point.

Source

pub fn executions_ep(&self) -> &ExtensionPoint<dyn ExecutionStore>

Returns the execution store extension point.

Source

pub fn runs_ep(&self) -> &ExtensionPoint<dyn RunStore>

Returns the run store extension point.

Source

pub fn embeddings_ep(&self) -> &ExtensionPoint<dyn EmbeddingStore>

Returns the embedding store extension point.

Source

pub fn artifacts_ep(&self) -> &ExtensionPoint<dyn ArtifactStore>

Returns the artifact store extension point.

Source

pub async fn ensure_session( &self, session_id: Option<Uuid>, ) -> RuntimeResult<Uuid>

Creates or loads a session.

§Errors

Returns RuntimeError::SessionNotFound when session_id is provided but does not exist, or RuntimeError::Storage on persistence failure.

Source

pub async fn append_message( &self, session_id: Uuid, message: &Message, ) -> RuntimeResult<Uuid>

Appends a message to a session.

§Errors

Returns RuntimeError::Storage on persistence failure.

Source

pub async fn list_messages( &self, session_id: Uuid, ) -> RuntimeResult<Vec<Message>>

Lists messages for a session.

§Errors

Returns RuntimeError::Storage on persistence failure.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more