Struct tdo_core::todo::Todo
[−]
[src]
pub struct Todo { pub id: u32, pub name: String, pub done: bool, }
Data Structure for a simple todo.
A Todo
item is the atomic unit within the tdo
microcosm.
It represents a single todo or task, which is identified by an ID.
Information about its state (done or undone) can be derived from
the data structure as well as the title of the todo item.
Fields
id: u32
Unique identifier for every Todo.
name: String
Title of the todo.
done: bool
Status of the todo.
Methods
impl Todo
[src]
fn new(id: u32, name: &str) -> Todo
Constructor. Creates a new Todo item.
fn edit(&mut self, new_name: &str)
Edit the title of a given Todo.
fn set_done(&mut self)
Set the status of a Todo item to done.
fn set_undone(&mut self)
Mark a todo item as undone.
Trait Implementations
impl Debug for Todo
[src]
impl Clone for Todo
[src]
fn clone(&self) -> Todo
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more