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>
pub fn set_session_nick( &self, session_id: &str, nick: &str, ) -> Result<(), ServerError>
pub fn session_nick( &self, session_id: &str, ) -> Result<Option<String>, ServerError>
Sourcepub fn active_runs_with_nick(&self) -> Result<Vec<(Run, String)>, ServerError>
pub fn active_runs_with_nick(&self) -> Result<Vec<(Run, String)>, ServerError>
(run, session nick) for every active run whose session has a nick.
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).
Sourcepub fn archive_task(
&self,
id: i64,
) -> Result<Result<Task, Refused>, ServerError>
pub fn archive_task( &self, id: i64, ) -> Result<Result<Task, Refused>, ServerError>
Operator archive of a finished task: hidden from lists, kept for history.
Sourcepub fn archive_session(
&self,
session_id: &str,
) -> Result<Result<(), Refused>, ServerError>
pub fn archive_session( &self, session_id: &str, ) -> Result<Result<(), Refused>, ServerError>
Operator archive of a session record with no running run: hidden from lists.
Sourcepub fn set_inventory(
&self,
node_id: &str,
providers: &[ProviderInventory],
) -> Result<(), ServerError>
pub fn set_inventory( &self, node_id: &str, providers: &[ProviderInventory], ) -> Result<(), ServerError>
Replace one node’s provider inventory (what the node detected; nothing else).
pub fn inventory(&self) -> Result<Vec<NodeInventory>, ServerError>
pub fn set_role(&self, role: &str, r: &Role) -> Result<(), ServerError>
pub fn delete_role(&self, role: &str) -> Result<bool, ServerError>
pub fn roles(&self) -> Result<BTreeMap<String, Role>, ServerError>
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.