Struct tdo_core::list::TodoList [] [src]

pub struct TodoList {
    pub name: String,
    pub list: Vec<Todo>,
}

Simple todo list structure.

Todos can be grouped together in so called todo lists (as in the real world). Therefore, the TodoList struct can be used. It's a simple data structure that holds a number of Todo items and offers all basic functions for managing them.

Fields

Name of the todo list.

The actual vector of Todo items.

Methods

impl TodoList
[src]

Create a new list with the given name.

Example

let mut list = TodoList::new("important");

Add a new todo to the list.

Example

list.add(Todo::new(0,"A first important todo"));

Check if the list contains a todo with the given ID.

This function returns a TdoResult, wich will contion a TodoError::NotInList if the list does not contain any todo with the given ID or the position in the list.

Mark a todo from the list with the given ID as done.

This function returns a TdoResult, which will contain a TodoError::NotInList if the list does not contain any todo with the given ID.

Remove a todo with the given ID from the list.

This function returns a TdoResult, which will contain the removed Todo itself or a TodoError::NotInList if the list does not contain any todo with the given id.

Search for all undone todos in the list.

Returns a vector of all undone todos.

Remove all done todos from the list.

Trait Implementations

impl Debug for TodoList
[src]

Formats the value using the given formatter.

impl Clone for TodoList
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for TodoList
[src]

Instanciates a default TodoList. This function is invoked when a Tdo container structure is instanciated.

Returns the "default value" for a type. Read more