pub struct Repository { /* private fields */ }Implementations§
Source§impl Repository
impl Repository
pub fn new(db_path: impl Into<PathBuf>) -> Self
pub fn db_path(&self) -> &Path
pub fn init(&self) -> AppResult<()>
pub fn insert_task(&self, new_task: &NewTaskRecord) -> AppResult<()>
pub fn get_task(&self, task_id: &str) -> AppResult<TaskRecord>
pub fn list_events(&self, task_id: &str) -> AppResult<Vec<EventRecord>>
pub fn count_accepted(&self) -> AppResult<u64>
pub fn count_running(&self) -> AppResult<u64>
pub fn count_by_status(&self, status: TaskStatus) -> AppResult<u64>
pub fn list_accepted(&self, limit: usize) -> AppResult<Vec<TaskRecord>>
pub fn list_non_terminal(&self) -> AppResult<Vec<TaskRecord>>
pub fn list_active_reservations(&self) -> AppResult<Vec<TaskRecord>>
pub fn count_accepted_waiting(&self) -> AppResult<u64>
pub fn mark_dispatched(&self, task_id: &str, shim_pid: u32) -> AppResult<()>
pub fn mark_started( &self, task_id: &str, pid: u32, pgid: i32, script_path: Option<&Path>, ) -> AppResult<()>
pub fn reserve_resources( &self, task_id: &str, reservation: &TaskResourceReservation, message: &str, ) -> AppResult<()>
pub fn release_resources(&self, task_id: &str, message: &str) -> AppResult<()>
pub fn set_cancel_requested(&self, task_id: &str) -> AppResult<TaskRecord>
pub fn mark_timeout_triggered(&self, task_id: &str) -> AppResult<()>
pub fn cancel_accepted_task( &self, task_id: &str, error: RuntimeErrorInfo, ) -> AppResult<()>
pub fn complete_task( &self, task_id: &str, update: &CompletionUpdate, ) -> AppResult<()>
pub fn mark_recovered(&self, task_id: &str) -> AppResult<()>
pub fn mark_recovery_lost(&self, task_id: &str) -> AppResult<()>
pub fn is_cancel_requested(&self, task_id: &str) -> AppResult<bool>
pub fn list_gc_candidates( &self, finished_before: DateTime<Utc>, ) -> AppResult<Vec<TaskRecord>>
pub fn delete_task(&self, task_id: &str) -> AppResult<()>
pub fn metrics_snapshot(&self) -> AppResult<MetricsSnapshot>
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Source§fn clone(&self) -> Repository
fn clone(&self) -> Repository
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnsafeUnpin for Repository
impl UnwindSafe for Repository
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