ITaskRepository

Trait ITaskRepository 

Source
pub trait ITaskRepository {
    // Required methods
    fn find_by_id(&self, id: ID) -> Result<Option<Task>>;
    fn find_opening(&self) -> Result<Vec<Task>>;
    fn fetch_all(&self) -> Result<Vec<Task>>;
    fn add(&self, a_task: Task) -> Result<ID>;
    fn update(&self, a_task: Task) -> Result<()>;
}
Expand description

ITaskRepository define interface of task repository.

Required Methods§

Source

fn find_by_id(&self, id: ID) -> Result<Option<Task>>

find a task by id.

Source

fn find_opening(&self) -> Result<Vec<Task>>

find tasks which is not closed.

Source

fn fetch_all(&self) -> Result<Vec<Task>>

fetch all tasks regardless whether it is closed.

Source

fn add(&self, a_task: Task) -> Result<ID>

add a task, and then return ID of the task.

Source

fn update(&self, a_task: Task) -> Result<()>

update the task.

Implementors§