pub struct FsStateStore { /* private fields */ }Expand description
A file system-based implementation of TaskStateStore. Each task’s state is stored as a JSON file in a specified directory.
Implementations§
Source§impl FsStateStore
impl FsStateStore
pub async fn new(base_path: impl AsRef<Path>) -> SupervisorResult<Self>
Trait Implementations§
Source§impl TaskStateStore for FsStateStore
impl TaskStateStore for FsStateStore
Source§fn save_state<'life0, 'async_trait>(
&'life0 self,
state: PersistedTaskState,
) -> Pin<Box<dyn Future<Output = SupervisorResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_state<'life0, 'async_trait>(
&'life0 self,
state: PersistedTaskState,
) -> Pin<Box<dyn Future<Output = SupervisorResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save the state of a task
Source§fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SupervisorResult<Option<PersistedTaskState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SupervisorResult<Option<PersistedTaskState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the state of a task by ID
Source§fn load_all_states<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SupervisorResult<Vec<PersistedTaskState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_all_states<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SupervisorResult<Vec<PersistedTaskState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load all saved task states
Source§fn delete_state<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SupervisorResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_state<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SupervisorResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete the state of a task
Auto Trait Implementations§
impl Freeze for FsStateStore
impl RefUnwindSafe for FsStateStore
impl Send for FsStateStore
impl Sync for FsStateStore
impl Unpin for FsStateStore
impl UnsafeUnpin for FsStateStore
impl UnwindSafe for FsStateStore
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