pub struct FileJobStore { /* private fields */ }Expand description
JSON-array file backend. All jobs in one file; mutations read-all → modify →
atomic rewrite. Mutex<()> serializes writers.
Implementations§
Trait Implementations§
Source§impl JobStore for FileJobStore
impl JobStore for FileJobStore
fn add<'life0, 'life1, 'async_trait>(
&'life0 self,
job: &'life1 Job,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Every job in the store, across owners. The scheduler wants this; a
user-facing caller almost always wants
list_for_owner instead.fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_enabled<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<bool, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_run<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
last_run_ms: i64,
next_run_ms: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn list_for_owner<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_for_owner<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Only the jobs belonging to
owner. The default filters list(), which
is correct for any backend; a database-backed store should override it
with a WHERE clause.Auto Trait Implementations§
impl !Freeze for FileJobStore
impl Forget for FileJobStore
impl RefUnwindSafe for FileJobStore
impl Send for FileJobStore
impl Sync for FileJobStore
impl Unpin for FileJobStore
impl UnsafeUnpin for FileJobStore
impl UnwindSafe for FileJobStore
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