Skip to main content

ExecutionStore

Struct ExecutionStore 

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

ExecutionStore - Main store class for managing execution records

Implementations§

Source§

impl ExecutionStore

Source

pub fn new() -> Self

Create a new ExecutionStore with default options

Source

pub fn with_options(options: ExecutionStoreOptions) -> Self

Create a new ExecutionStore with options

Source

pub fn read_lino_records(&self) -> Vec<ExecutionRecord>

Read all execution records from lino file

Convert a record’s properties to clink links notation.

The record is one link (uuid: ExecutionRecord uuid) plus one link per property, (uuid.key: uuid "key=value"). Property links have the record as their source, so records that share a value stay distinct links (doublets are deduplicated by source and target), and the key= prefix keeps a number from being read as a link address (issue #253).

Build the create query with the same notation as the property helper.

Source

pub fn save(&self, record: &ExecutionRecord) -> Result<(), String>

Save an execution record (creates or updates)

Source

pub fn reserve_launch( &self, record: &ExecutionRecord, previous: &ExecutionRecord, ) -> Result<(), String>

Source

pub fn patch_attempt( &self, uuid: &str, number: u64, fields: Value, ) -> Result<Option<ExecutionRecord>, String>

Merge attempt metadata under the lock without replacing a watcher’s terminal state.

Source

pub fn mark_container_removed( &self, uuid: &str, observed_at: &str, ) -> Result<Option<ExecutionRecord>, String>

Record that a finished execution’s container no longer exists (issue #225). Applied under the lock, and only while the record is still finished, so a concurrent resume is never undone.

Source

pub fn get(&self, identifier: &str) -> Option<ExecutionRecord>

Get an execution record by UUID, session name, earlier session name (issue #162), display name or alias (issue #231).

Source

pub fn with_lock<F>(&self, mutate: F) -> Result<Option<ExecutionRecord>, String>

Run mutate on the stored records under the database lock and persist them when it returns a changed record (issues #229, #231).

Source

pub fn get_all(&self) -> Vec<ExecutionRecord>

Get all execution records

Source

pub fn get_by_status(&self, status: ExecutionStatus) -> Vec<ExecutionRecord>

Get records filtered by status

Source

pub fn get_executing(&self) -> Vec<ExecutionRecord>

Get currently executing commands

Source

pub fn get_recent(&self, limit: usize) -> Vec<ExecutionRecord>

Get recently executed commands (sorted by start_time descending)

Source

pub fn cleanup_stale(&self, options: CleanupOptions) -> CleanupResult

Clean up stale “executing” records (processes no longer running or aged out)

Source

pub fn delete(&self, uuid: &str) -> Result<bool, String>

Delete an execution record

Source

pub fn clear(&self) -> Result<(), String>

Delete all records

Source

pub fn verify_consistency(&self) -> ConsistencyResult

Verify that both databases have consistent data

Source

pub fn get_stats(&self) -> ExecutionStats

Get database statistics

Source

pub fn app_folder(&self) -> &Path

Get the app folder path

Trait Implementations§

Source§

impl Clone for ExecutionStore

Source§

fn clone(&self) -> Self

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 Default for ExecutionStore

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.