Skip to main content

PlanStorage

Defined in the planning module.
Rust AI Agent SDK Storage for plans.

Fields

NameTypeDescription
plansHashMap<StringPlans by ID
pathOption<PathBuf>Storage path

Methods

new

fn new() -> Self
Create a new storage.

with_path

fn with_path(path: impl Into<PathBuf>) -> Self
Create with file path. Parameters:
NameType
pathimpl Into&lt;PathBuf&gt;

save

fn save(&mut self, plan: Plan) -> ()
Save a plan. Parameters:
NameType
planPlan

load

fn load(&self, id: &str) -> Option<&Plan>
Load a plan by ID. Parameters:
NameType
id&str

load_mut

fn load_mut(&mut self, id: &str) -> Option<&mut Plan>
Load mutable plan by ID. Parameters:
NameType
id&str

delete

fn delete(&mut self, id: &str) -> Option<Plan>
Delete a plan. Parameters:
NameType
id&str

list

fn list(&self) -> Vec<&Plan>
List all plans.

count

fn count(&self) -> usize
Get 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 GitHub

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