Skip to main content

TasksFacade

Trait TasksFacade 

Source
pub(crate) trait TasksFacade: Send + Sync {
    // Required methods
    fn create_task(
        &self,
        caller: &SessionSlot,
        draft: TaskDraft,
    ) -> Result<Task, TasksError>;
    fn list_tasks(
        &self,
        caller: &SessionSlot,
        owner: Option<&str>,
        parent: Option<&TaskId>,
        status: Option<TaskStatus>,
        ready: Option<bool>,
    ) -> Vec<BoardRow>;
    fn update_task(
        &self,
        caller: &SessionSlot,
        id: &TaskId,
        patch: TaskPatch,
    ) -> Result<Task, TasksError>;
    fn delete_task(
        &self,
        caller: &SessionSlot,
        id: &TaskId,
    ) -> Result<RemovedTaskTree, TasksError>;
    fn claim_task(
        &self,
        caller: &SessionSlot,
        id: Option<&str>,
        epic: Option<&str>,
    ) -> Result<Task, TasksError>;
    fn wait_task(
        &self,
        caller: &SessionSlot,
        id: &TaskId,
        kind: WaitingKind,
        detail: Option<String>,
        on: Option<&TaskId>,
    ) -> Result<Task, TasksError>;
    fn attest_task(
        &self,
        caller: &SessionSlot,
        id: &TaskId,
        approval: &str,
    ) -> Result<Task, TasksError>;
}
Expand description

The task tools’ view of the workspace. Sync - task-list mutations are direct state writes with no async handler to await.

Required Methods§

Source

fn create_task( &self, caller: &SessionSlot, draft: TaskDraft, ) -> Result<Task, TasksError>

Register a task for the caller’s project and return the new record, with its id and timestamps stamped.

Source

fn list_tasks( &self, caller: &SessionSlot, owner: Option<&str>, parent: Option<&TaskId>, status: Option<TaskStatus>, ready: Option<bool>, ) -> Vec<BoardRow>

The caller’s project’s board rows, narrowed by owner (a label), parent (a task id), status and ready when supplied.

Source

fn update_task( &self, caller: &SessionSlot, id: &TaskId, patch: TaskPatch, ) -> Result<Task, TasksError>

Apply patch to the task id in the caller’s project and return the record as the write left it. A missing id names its case: TasksError::NoSuchTask when the project has no such id, TasksError::TaskInAnotherProject when another project holds it. Open to every session in the project.

Source

fn delete_task( &self, caller: &SessionSlot, id: &TaskId, ) -> Result<RemovedTaskTree, TasksError>

Remove the task id and its descendants within the caller’s project, returning the named task as it stood and how many descendants went with it. A missing id names its case the way TasksFacade::update_task does.

Source

fn claim_task( &self, caller: &SessionSlot, id: Option<&str>, epic: Option<&str>, ) -> Result<Task, TasksError>

Claim id, or the first ready row of epic by rank, for the caller. Backs tasks__claim.

Source

fn wait_task( &self, caller: &SessionSlot, id: &TaskId, kind: WaitingKind, detail: Option<String>, on: Option<&TaskId>, ) -> Result<Task, TasksError>

Put the caller’s row id into waiting. Backs tasks__wait.

Source

fn attest_task( &self, caller: &SessionSlot, id: &TaskId, approval: &str, ) -> Result<Task, TasksError>

The lead completes a look wait with the approval the user gave, quoted. Backs tasks__approve; the core refuses a non-lead.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§