pub struct Plan {
pub goal: String,
pub items: Vec<PlanItem>,
pub next_id: u32,
pub created: u64,
pub updated: u64,
}Fields§
§goal: String§items: Vec<PlanItem>§next_id: u32§created: u64§updated: u64Implementations§
Source§impl Plan
impl Plan
Sourcepub fn create(
goal: &str,
items: &[Value],
max_items: usize,
) -> Result<Plan, String>
pub fn create( goal: &str, items: &[Value], max_items: usize, ) -> Result<Plan, String>
plan.create {goal, items: [{title, detail?}]}.
Sourcepub fn update(&mut self, args: &Value, max_items: usize) -> Result<(), String>
pub fn update(&mut self, args: &Value, max_items: usize) -> Result<(), String>
plan.update {item, status?, note?, bind?, insert?, reorder?, title?, detail?}:
item addresses by id (number) or by exact title; insert = {title, detail?, after?: id} adds a new item (no item needed); reorder =
[ids…] sets the order.
Sourcepub fn settle_binding(
&mut self,
binding: &Binding,
ok: bool,
note: Option<&str>,
) -> Vec<u32>
pub fn settle_binding( &mut self, binding: &Binding, ok: bool, note: Option<&str>, ) -> Vec<u32>
Auto-advance every item bound to binding: a terminal outcome marks
the item done (success) or blocked (failure), with the outcome kept as
the note. Items already in a terminal status are left alone, so a
replayed settle cannot un-finish work. Returns the ids advanced.
pub fn is_complete(&self) -> bool
pub fn to_value(&self) -> Value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Plan
impl<'de> Deserialize<'de> for Plan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Plan
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more