Skip to main content

InMemoryStore

Struct InMemoryStore 

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

In-memory store backed by Arc<RwLock<..>>.

Thread-safe and cheap to clone. All data is held in memory and lost on drop.

§Examples

use ironflow_store::memory::InMemoryStore;

let store = InMemoryStore::new();
let store2 = store.clone(); // cheap Arc clone

Implementations§

Source§

impl InMemoryStore

Source

pub fn new() -> Self

Create a new empty in-memory store.

§Examples
use ironflow_store::memory::InMemoryStore;

let store = InMemoryStore::new();

Trait Implementations§

Source§

impl ApiKeyStore for InMemoryStore

Source§

fn create_api_key(&self, req: NewApiKey) -> StoreFuture<'_, ApiKey>

Create a new API key.
Source§

fn find_api_key_by_prefix( &self, prefix: &str, ) -> StoreFuture<'_, Option<ApiKey>>

Find an API key by its prefix (first 8 chars). Read more
Source§

fn find_api_key_by_id(&self, id: Uuid) -> StoreFuture<'_, Option<ApiKey>>

Find an API key by ID.
Source§

fn list_api_keys_by_user(&self, user_id: Uuid) -> StoreFuture<'_, Vec<ApiKey>>

List all API keys for a user.
Source§

fn update_api_key(&self, id: Uuid, update: ApiKeyUpdate) -> StoreFuture<'_, ()>

Update an API key.
Source§

fn touch_api_key(&self, id: Uuid) -> StoreFuture<'_, ()>

Record that an API key was used (updates last_used_at).
Source§

fn delete_api_key(&self, id: Uuid) -> StoreFuture<'_, ()>

Delete an API key.
Source§

impl Clone for InMemoryStore

Source§

fn clone(&self) -> InMemoryStore

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InMemoryStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl RunStore for InMemoryStore

Source§

fn create_run(&self, req: NewRun) -> StoreFuture<'_, Run>

Create a new run in Pending status.
Source§

fn get_run(&self, id: Uuid) -> StoreFuture<'_, Option<Run>>

Get a run by ID. Returns None if not found.
Source§

fn list_runs( &self, filter: RunFilter, page: u32, per_page: u32, ) -> StoreFuture<'_, Page<Run>>

List runs matching the given filter, with pagination. Read more
Source§

fn update_run_status( &self, id: Uuid, new_status: RunStatus, ) -> StoreFuture<'_, ()>

Update a run’s status with FSM validation. Read more
Source§

fn update_run(&self, id: Uuid, update: RunUpdate) -> StoreFuture<'_, ()>

Apply a partial update to a run. Read more
Source§

fn pick_next_pending(&self) -> StoreFuture<'_, Option<Run>>

Atomically pick the oldest pending run and transition it to Running. Read more
Source§

fn create_step(&self, req: NewStep) -> StoreFuture<'_, Step>

Create a new step for a run. Read more
Source§

fn update_step(&self, id: Uuid, update: StepUpdate) -> StoreFuture<'_, ()>

Apply a partial update to a step after execution. Read more
Source§

fn list_steps(&self, run_id: Uuid) -> StoreFuture<'_, Vec<Step>>

List all steps for a run, ordered by position ascending.
Source§

fn get_stats(&self) -> StoreFuture<'_, RunStats>

Get aggregated statistics across all runs. Read more
Source§

fn create_step_dependencies( &self, deps: Vec<NewStepDependency>, ) -> StoreFuture<'_, ()>

Create step dependency edges in batch. Read more
Source§

fn list_step_dependencies( &self, run_id: Uuid, ) -> StoreFuture<'_, Vec<StepDependency>>

List all step dependencies for a given run. Read more
Source§

fn update_run_returning( &self, id: Uuid, update: RunUpdate, ) -> StoreFuture<'_, Run>

Apply a partial update to a run and return the updated run. Read more
Source§

impl UserStore for InMemoryStore

Source§

fn create_user(&self, req: NewUser) -> StoreFuture<'_, User>

Create a new user. Read more
Source§

fn find_user_by_email(&self, email: &str) -> StoreFuture<'_, Option<User>>

Find a user by email. Returns None if not found.
Source§

fn find_user_by_id(&self, id: Uuid) -> StoreFuture<'_, Option<User>>

Find a user by ID. Returns None if not found.

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