Todo List • Rust AI Agent SDK

TodoList: A todo list.

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

rust
fn new(name: impl Into<String>) -> Self

Create a new todo list.

Parameters:

NameType
nameimpl Into&lt;String&gt;

add

rust
fn add(&mut self, item: TodoItem) -> ()

Add an item.

Parameters:

NameType
itemTodoItem

get

rust
fn get(&self, id: &str) -> Option<&TodoItem>

Get item by ID.

Parameters:

NameType
id&str

get_mut

rust
fn get_mut(&mut self, id: &str) -> Option<&mut TodoItem>

Get mutable item by ID.

Parameters:

NameType
id&str

remove

rust
fn remove(&mut self, id: &str) -> Option<TodoItem>

Remove item by ID.

Parameters:

NameType
id&str

pending

rust
fn pending(&self) -> Vec<&TodoItem>

Get pending items.

completed

rust
fn completed(&self) -> Vec<&TodoItem>

Get completed items.

overdue

rust
fn overdue(&self) -> Vec<&TodoItem>

Get overdue items.

by_tag

rust
fn by_tag(&self, tag: &str) -> Vec<&TodoItem>

Get items by tag.

Parameters:

NameType
tag&str

by_priority

rust
fn by_priority(&self, priority: TodoPriority) -> Vec<&TodoItem>

Get items by priority.

Parameters:

NameType
priorityTodoPriority

len

rust
fn len(&self) -> usize

Get item count.

is_empty

rust
fn is_empty(&self) -> bool

Check if empty.

progress

rust
fn progress(&self) -> f64

Get progress percentage.

Source

View on GitHub

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