pub struct MemoryRunLedger { /* private fields */ }Expand description
In-memory run ledger backed by a HashMap<RunId, RunState>.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryRunLedger
impl Debug for MemoryRunLedger
Source§impl Default for MemoryRunLedger
impl Default for MemoryRunLedger
Source§fn default() -> MemoryRunLedger
fn default() -> MemoryRunLedger
Returns the “default value” for a type. Read more
Source§impl RunLedger for MemoryRunLedger
impl RunLedger for MemoryRunLedger
Source§fn create_run<'life0, 'life1, 'async_trait>(
&'life0 self,
spec_digest: &'life1 ContentDigest,
metadata: RunMetadata,
) -> Pin<Box<dyn Future<Output = StorageResult<RunId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_run<'life0, 'life1, 'async_trait>(
&'life0 self,
spec_digest: &'life1 ContentDigest,
metadata: RunMetadata,
) -> Pin<Box<dyn Future<Output = StorageResult<RunId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new run, returning its unique ID.
Source§fn append_event<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
event: RunEvent,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_event<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
event: RunEvent,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append an event to an active run. Fails if the run is completed/failed.
Source§fn complete_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
summary: RunSummary,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
summary: RunSummary,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark a run as completed with a summary.
Source§fn fail_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
summary: RunSummary,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fail_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
summary: RunSummary,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark a run as failed with a summary.
Source§fn cancel_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
summary: RunSummary,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cancel_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
summary: RunSummary,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mark a run as cancelled.
Source§fn get_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
) -> Pin<Box<dyn Future<Output = StorageResult<RunRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
) -> Pin<Box<dyn Future<Output = StorageResult<RunRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a run record by ID.
Source§fn get_events<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<RunEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_events<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 RunId,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<RunEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve all events for a run, ordered by seq.
Source§fn list_runs<'life0, 'life1, 'async_trait>(
&'life0 self,
spec_digest: Option<&'life1 ContentDigest>,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<RunRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_runs<'life0, 'life1, 'async_trait>(
&'life0 self,
spec_digest: Option<&'life1 ContentDigest>,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<RunRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List runs, optionally filtered by spec digest.
Auto Trait Implementations§
impl !Freeze for MemoryRunLedger
impl RefUnwindSafe for MemoryRunLedger
impl Send for MemoryRunLedger
impl Sync for MemoryRunLedger
impl Unpin for MemoryRunLedger
impl UnsafeUnpin for MemoryRunLedger
impl UnwindSafe for MemoryRunLedger
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
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