Todo List • Rust AI Agent SDK
TodoList: A todo list.
TodoList
Defined in the planning module.
Rust AI Agent SDK
A todo list.
Fields
| Name | Type | Description |
|---|---|---|
name | String | List name |
items | Vec<TodoItem> | Items in the list |
Methods
new
fn new(name: impl Into<String>) -> SelfCreate a new todo list.
Parameters:
| Name | Type |
|---|---|
name | impl Into<String> |
add
fn add(&mut self, item: TodoItem) -> ()Add an item.
Parameters:
| Name | Type |
|---|---|
item | TodoItem |
get
fn get(&self, id: &str) -> Option<&TodoItem>Get item by ID.
Parameters:
| Name | Type |
|---|---|
id | &str |
get_mut
fn get_mut(&mut self, id: &str) -> Option<&mut TodoItem>Get mutable item by ID.
Parameters:
| Name | Type |
|---|---|
id | &str |
remove
fn remove(&mut self, id: &str) -> Option<TodoItem>Remove item by ID.
Parameters:
| Name | Type |
|---|---|
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:
| Name | Type |
|---|---|
tag | &str |
by_priority
fn by_priority(&self, priority: TodoPriority) -> Vec<&TodoItem>Get items by priority.
Parameters:
| Name | Type |
|---|---|
priority | TodoPriority |
len
fn len(&self) -> usizeGet item count.
is_empty
fn is_empty(&self) -> boolCheck if empty.
progress
fn progress(&self) -> f64Get progress percentage.
Source
View on GitHubpraisonai/src/planning/mod.rs at line 311