Skip to main content

TodoList

Defined in the planning module.
Rust AI Agent SDK A todo list.

Fields

NameTypeDescription
nameStringList name
itemsVec<TodoItem>Items in the list

Methods

new

fn new(name: impl Into<String>) -> Self
Create a new todo list. Parameters:
NameType
nameimpl Into&lt;String&gt;

add

fn add(&mut self, item: TodoItem) -> ()
Add an item. Parameters:
NameType
itemTodoItem

get

fn get(&self, id: &str) -> Option<&TodoItem>
Get item by ID. Parameters:
NameType
id&str

get_mut

fn get_mut(&mut self, id: &str) -> Option<&mut TodoItem>
Get mutable item by ID. Parameters:
NameType
id&str

remove

fn remove(&mut self, id: &str) -> Option<TodoItem>
Remove item by ID. Parameters:
NameType
id&str

pending

fn pending(&self) -> Vec<&TodoItem>
Get pending items.

completed

fn completed(&self) -> Vec<&TodoItem>
Get completed items.

overdue

fn overdue(&self) -> Vec<&TodoItem>
Get overdue items.

by_tag

fn by_tag(&self, tag: &str) -> Vec<&TodoItem>
Get items by tag. Parameters:
NameType
tag&str

by_priority

fn by_priority(&self, priority: TodoPriority) -> Vec<&TodoItem>
Get items by priority. Parameters:
NameType
priorityTodoPriority

len

fn len(&self) -> usize
Get item count.

is_empty

fn is_empty(&self) -> bool
Check if empty.

progress

fn progress(&self) -> f64
Get progress percentage.

Source

View on GitHub

praisonai/src/planning/mod.rs at line 311