pub struct InMemoryRunStore { /* private fields */ }Implementations§
Source§impl InMemoryRunStore
impl InMemoryRunStore
pub fn new() -> Self
Sourcepub fn with_retention(
max_runs: Option<usize>,
max_events_per_run: Option<usize>,
) -> Self
pub fn with_retention( max_runs: Option<usize>, max_events_per_run: Option<usize>, ) -> Self
Construct a store with optional FIFO retention caps. None
fields keep the unbounded default.
Sourcepub fn with_retention_limits(
max_runs: Option<usize>,
max_events_per_run: Option<usize>,
max_event_bytes_per_run: Option<usize>,
) -> Self
pub fn with_retention_limits( max_runs: Option<usize>, max_events_per_run: Option<usize>, max_event_bytes_per_run: Option<usize>, ) -> Self
Construct a store with count and serialized-byte FIFO retention caps.
pub async fn create_run(&self, session_id: &str, prompt: &str) -> RunSnapshot
Sourcepub async fn create_run_with_id(
&self,
id: String,
session_id: &str,
prompt: &str,
) -> RunSnapshot
pub async fn create_run_with_id( &self, id: String, session_id: &str, prompt: &str, ) -> RunSnapshot
Create a run with a caller-supplied id. Used by the session
orchestration layer so the parent session’s host-provided
IdGenerator governs run ids.
pub async fn record_event( &self, run_id: &str, event: AgentEvent, ) -> Option<RunSnapshot>
pub async fn mark_failed( &self, run_id: &str, error: impl Into<String>, ) -> Option<RunSnapshot>
pub async fn mark_cancelled(&self, run_id: &str) -> Option<RunSnapshot>
pub async fn snapshot(&self, run_id: &str) -> Option<RunSnapshot>
pub async fn events(&self, run_id: &str) -> Vec<RunEventRecord>
Sourcepub async fn event_page(
&self,
run_id: &str,
after_sequence: Option<usize>,
limit: usize,
) -> Option<RunEventPage>
pub async fn event_page( &self, run_id: &str, after_sequence: Option<usize>, limit: usize, ) -> Option<RunEventPage>
Return retained events strictly after after_sequence, bounded by
limit. The page reports when the requested cursor predates the
retained FIFO window. None distinguishes an unknown run from a known
run whose event window is empty.
pub async fn list(&self) -> Vec<RunSnapshot>
pub async fn records(&self) -> Vec<RunRecord>
pub async fn replace_records(&self, records: Vec<RunRecord>)
Trait Implementations§
Source§impl Debug for InMemoryRunStore
impl Debug for InMemoryRunStore
Source§impl Default for InMemoryRunStore
impl Default for InMemoryRunStore
Source§fn default() -> InMemoryRunStore
fn default() -> InMemoryRunStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryRunStore
impl !RefUnwindSafe for InMemoryRunStore
impl !UnwindSafe for InMemoryRunStore
impl Send for InMemoryRunStore
impl Sync for InMemoryRunStore
impl Unpin for InMemoryRunStore
impl UnsafeUnpin for InMemoryRunStore
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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