pub struct TaskStore { /* private fields */ }Implementations§
Source§impl TaskStore
impl TaskStore
pub fn open(data_dir: &Path) -> Result<Self, ServerError>
pub fn in_memory() -> Result<Self, ServerError>
Sourcepub fn replay(&self, op_id: Option<&str>) -> Result<Option<Value>, ServerError>
pub fn replay(&self, op_id: Option<&str>) -> Result<Option<Value>, ServerError>
Replay a recorded operation result, if op_id was seen.
pub fn record( &self, op_id: Option<&str>, result: &Value, ) -> Result<(), ServerError>
pub fn create( &self, title: &str, body: &str, assignee: Option<&str>, ) -> Result<Task, ServerError>
pub fn create_full( &self, title: &str, body: &str, assignee: Option<&str>, role: Option<&str>, parent_id: Option<i64>, status: Option<&str>, ) -> Result<Task, ServerError>
pub fn get(&self, id: i64) -> Result<Option<Task>, ServerError>
pub fn list( &self, assignee: Option<&str>, open_only: bool, ) -> Result<Vec<Task>, ServerError>
Sourcepub fn list_filtered(
&self,
assignee: Option<&str>,
roles: Option<&[String]>,
open_only: bool,
) -> Result<Vec<Task>, ServerError>
pub fn list_filtered( &self, assignee: Option<&str>, roles: Option<&[String]>, open_only: bool, ) -> Result<Vec<Task>, ServerError>
roles: when set, only tasks without a role or with one of these roles.
pub fn assign(&self, id: i64, assignee: &str) -> Result<bool, ServerError>
Sourcepub fn move_to(
&self,
id: i64,
status: &str,
expected: Option<i64>,
) -> Result<Result<Task, Refused>, ServerError>
pub fn move_to( &self, id: i64, status: &str, expected: Option<i64>, ) -> Result<Result<Task, Refused>, ServerError>
Move a task to status (operator), with optional revision check.
Sourcepub fn set_status(
&self,
id: i64,
status: &str,
only_assignee: Option<&str>,
) -> Result<bool, ServerError>
pub fn set_status( &self, id: i64, status: &str, only_assignee: Option<&str>, ) -> Result<bool, ServerError>
Operator cancel, or the assignee moving its own task along (in_progress, done).
pub fn upsert_session(&self, s: &Session) -> Result<Session, ServerError>
pub fn session(&self, id: &str) -> Result<Option<Session>, ServerError>
pub fn sessions(&self, node: Option<&str>) -> Result<Vec<Session>, ServerError>
Sourcepub fn start_run(
&self,
task_id: i64,
session_id: &str,
) -> Result<Result<Run, Refused>, ServerError>
pub fn start_run( &self, task_id: i64, session_id: &str, ) -> Result<Result<Run, Refused>, ServerError>
Bind a task to a recorded session. The task moves to in_progress.
pub fn run(&self, id: i64) -> Result<Option<Run>, ServerError>
pub fn runs(&self, task_id: i64) -> Result<Vec<Run>, ServerError>
pub fn active_run(&self, task_id: i64) -> Result<Option<Run>, ServerError>
Sourcepub fn close_run(
&self,
run_id: i64,
status: &str,
by: &str,
caller_session: Option<&str>,
branch: Option<&str>,
commit_id: Option<&str>,
result_message_id: Option<&str>,
) -> Result<Result<Run, Refused>, ServerError>
pub fn close_run( &self, run_id: i64, status: &str, by: &str, caller_session: Option<&str>, branch: Option<&str>, commit_id: Option<&str>, result_message_id: Option<&str>, ) -> Result<Result<Run, Refused>, ServerError>
Close (or move to review) a run. by is session (the run’s own session, via m4a)
or operator (override). A session may not reopen or touch a closed run; the
operator may override any non-cancelled run. The task follows the run.
Auto Trait Implementations§
impl !Freeze for TaskStore
impl !RefUnwindSafe for TaskStore
impl !Sync for TaskStore
impl !UnwindSafe for TaskStore
impl Send for TaskStore
impl Unpin for TaskStore
impl UnsafeUnpin for TaskStore
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