Plan Storage • Rust AI Agent SDK
PlanStorage: Storage for plans.
PlanStorage
Defined in the planning module.
Rust AI Agent SDK
Storage for plans.
Fields
| Name | Type | Description |
|---|---|---|
plans | HashMap<String | Plans by ID |
path | Option<PathBuf> | Storage path |
Methods
new
fn new() -> SelfCreate a new storage.
with_path
fn with_path(path: impl Into<PathBuf>) -> SelfCreate with file path.
Parameters:
| Name | Type |
|---|---|
path | impl Into<PathBuf> |
save
fn save(&mut self, plan: Plan) -> ()Save a plan.
Parameters:
| Name | Type |
|---|---|
plan | Plan |
load
fn load(&self, id: &str) -> Option<&Plan>Load a plan by ID.
Parameters:
| Name | Type |
|---|---|
id | &str |
load_mut
fn load_mut(&mut self, id: &str) -> Option<&mut Plan>Load mutable plan by ID.
Parameters:
| Name | Type |
|---|---|
id | &str |
delete
fn delete(&mut self, id: &str) -> Option<Plan>Delete a plan.
Parameters:
| Name | Type |
|---|---|
id | &str |
list
fn list(&self) -> Vec<&Plan>List all plans.
count
fn count(&self) -> usizeGet plan count.
persist
fn persist(&self) -> std::io::Result<()>Save to file.
restore
fn restore(&mut self) -> std::io::Result<()>Load from file.
Source
View on GitHubpraisonai/src/planning/mod.rs at line 402