Struct tdo_core::tdo::Tdo [] [src]

pub struct Tdo {
    pub lists: Vec<TodoList>,
    // some fields omitted
}

Basic container structure for a set of todo lists.

This data structure acts as a conatiner for all todo lists and its associated todos. The whole tdo microcosm settles around this structure which is also used for (de-)serialization.

When instanciated, it comes with an empty default list.

Fields

A vector of all todo lists.

Methods

impl Tdo
[src]

Create a new Tdo container. Each new container is instanciated with a default TodoList.

Example

let tdo = Tdo::new();

Load a saved Tdo container from a JSON file.

This function returns a ResultType which will yield the deserialized JSON or a serde_json::Error.

Example

let mut tdo = Tdo::load("foo.json");

Dump the Tdo container to a JSON file.

This function returns a ResultType yielding a StorageError::SaveFailure if the JSON file could not be opened/saved.

Example

let res = tdo.save("foo.json");
assert_eq!(res.unwrap(), ());

Sets the GitHub access token.

Returns an Option of the private access_token field.

Add a todo list to the container.

Removes a list from the container.

Add a todo to the todo list, identified by its name.

This function returns a ResultType with a TodoError::NoSuchList if there is no matching list found.

Cycle through all todo lists and find the list which contains the todo with the given ID

This function retuns a ResultType with a TodoError::NotInList if there is no list found or a usize with the postition of the list in lists.

Cycle through all todo lists and mark a todo with the given ID as done. This function has no return value and thus won't indicate whether there was a matching todo found.

Cycle through all todo lists and remove a todo with the given id. This function has no return value and thus won't indicate whether there was a matching todo found.

Remove all todos that have been marked as done from all todo lists.

Remove all todos that have been marked as done from a given todo list.

Get the highest ID used in the tdo container.

Move a todo between two lists.

Trait Implementations

impl Debug for Tdo
[src]

Formats the value using the given formatter.

impl Clone for Tdo
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more