[][src]Trait libimagtodo::taskstore::TaskStore

pub trait TaskStore<'a> {
    fn import_task_from_reader<R: BufRead>(
        &'a self,
        r: R
    ) -> Result<(FileLockEntry<'a>, String, Uuid)>;
fn get_task_from_import<R: BufRead>(
        &'a self,
        r: R
    ) -> Result<RResult<FileLockEntry<'a>, String>>;
fn get_task_from_string(
        &'a self,
        s: String
    ) -> Result<RResult<FileLockEntry<'a>, String>>;
fn get_task_from_uuid(
        &'a self,
        uuid: Uuid
    ) -> Result<Option<FileLockEntry<'a>>>;
fn retrieve_task_from_import<R: BufRead>(
        &'a self,
        r: R
    ) -> Result<FileLockEntry<'a>>;
fn retrieve_task_from_string(
        &'a self,
        s: String
    ) -> Result<FileLockEntry<'a>>;
fn delete_tasks_by_imports<R: BufRead>(&self, r: R) -> Result<()>;
fn delete_task_by_uuid(&self, uuid: Uuid) -> Result<()>;
fn all_tasks(&self) -> Result<TaskIdIterator>;
fn new_from_twtask(&'a self, task: TTask) -> Result<FileLockEntry<'a>>; }

Task struct containing a FileLockEntry

Required methods

fn import_task_from_reader<R: BufRead>(
    &'a self,
    r: R
) -> Result<(FileLockEntry<'a>, String, Uuid)>

fn get_task_from_import<R: BufRead>(
    &'a self,
    r: R
) -> Result<RResult<FileLockEntry<'a>, String>>

fn get_task_from_string(
    &'a self,
    s: String
) -> Result<RResult<FileLockEntry<'a>, String>>

fn get_task_from_uuid(&'a self, uuid: Uuid) -> Result<Option<FileLockEntry<'a>>>

fn retrieve_task_from_import<R: BufRead>(
    &'a self,
    r: R
) -> Result<FileLockEntry<'a>>

fn retrieve_task_from_string(&'a self, s: String) -> Result<FileLockEntry<'a>>

fn delete_tasks_by_imports<R: BufRead>(&self, r: R) -> Result<()>

fn delete_task_by_uuid(&self, uuid: Uuid) -> Result<()>

fn all_tasks(&self) -> Result<TaskIdIterator>

fn new_from_twtask(&'a self, task: TTask) -> Result<FileLockEntry<'a>>

Loading content...

Implementations on Foreign Types

impl<'a> TaskStore<'a> for Store[src]

fn get_task_from_import<R: BufRead>(
    &'a self,
    r: R
) -> Result<RResult<FileLockEntry<'a>, String>>
[src]

Get a task from an import string. That is: read the imported string, get the UUID from it and try to load this UUID from store.

Possible return values are:

  • Ok(Ok(Task))
  • Ok(Err(String)) - where the String is the String read from the r parameter
  • Err(_) - where the error is an error that happened during evaluation

fn get_task_from_string(
    &'a self,
    s: String
) -> Result<RResult<FileLockEntry<'a>, String>>
[src]

Get a task from a String. The String is expected to contain the JSON-representation of the Task to get from the store (only the UUID really matters in this case)

For an explanation on the return values see Task::get_from_import().

fn get_task_from_uuid(&'a self, uuid: Uuid) -> Result<Option<FileLockEntry<'a>>>[src]

Get a task from an UUID.

If there is no task with this UUID, this returns Ok(None).

fn retrieve_task_from_import<R: BufRead>(
    &'a self,
    r: R
) -> Result<FileLockEntry<'a>>
[src]

Same as Task::get_from_import() but uses Store::retrieve() rather than Store::get(), to implicitely create the task if it does not exist.

fn retrieve_task_from_string(&'a self, s: String) -> Result<FileLockEntry<'a>>[src]

Retrieve a task from a String. The String is expected to contain the JSON-representation of the Task to retrieve from the store (only the UUID really matters in this case)

Loading content...

Implementors

Loading content...