pub struct JsonFileStore { /* private fields */ }Expand description
JSON file-backed store for durable pool state.
Tasks are stored as individual JSON files under {dir}/tasks/{id}.json
and slots under {dir}/slots/{id}.json. This makes state inspectable
with standard tools and survives process restarts.
Implementations§
Trait Implementations§
Source§impl Debug for JsonFileStore
impl Debug for JsonFileStore
Source§impl PoolStore for JsonFileStore
impl PoolStore for JsonFileStore
Source§fn put_task<'life0, 'async_trait>(
&'life0 self,
record: TaskRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_task<'life0, 'async_trait>(
&'life0 self,
record: TaskRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or update a task record.
Source§fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a task by ID.
Source§fn list_tasks<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 TaskFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_tasks<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 TaskFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List tasks matching an optional filter.
Source§fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a task record.
Source§fn put_slot<'life0, 'async_trait>(
&'life0 self,
record: SlotRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_slot<'life0, 'async_trait>(
&'life0 self,
record: SlotRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or update a slot record.
Source§fn get_slot<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SlotId,
) -> Pin<Box<dyn Future<Output = Result<Option<SlotRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_slot<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SlotId,
) -> Pin<Box<dyn Future<Output = Result<Option<SlotRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a slot by ID.
Source§fn list_slots<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SlotRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_slots<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SlotRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all slots.
Auto Trait Implementations§
impl Freeze for JsonFileStore
impl RefUnwindSafe for JsonFileStore
impl Send for JsonFileStore
impl Sync for JsonFileStore
impl Unpin for JsonFileStore
impl UnsafeUnpin for JsonFileStore
impl UnwindSafe for JsonFileStore
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