pub struct PlanStore {
pub total_generated: u64,
pub total_succeeded: u64,
pub total_failed: u64,
/* private fields */
}Expand description
Stores active plans for goals.
Fields§
§total_generated: u64How many plans have been generated lifetime.
total_succeeded: u64How many plans were executed successfully.
total_failed: u64How many plans failed or were abandoned.
Implementations§
Source§impl PlanStore
impl PlanStore
pub fn new() -> Self
Sourcepub fn mark_succeeded(&mut self, goal_id: NodeId) -> Option<Plan>
pub fn mark_succeeded(&mut self, goal_id: NodeId) -> Option<Plan>
Mark a plan as succeeded and remove it.
Sourcepub fn mark_failed(&mut self, goal_id: NodeId) -> Option<Plan>
pub fn mark_failed(&mut self, goal_id: NodeId) -> Option<Plan>
Mark a plan as failed and remove it.
Sourcepub fn remove_plan(&mut self, goal_id: NodeId) -> Option<Plan>
pub fn remove_plan(&mut self, goal_id: NodeId) -> Option<Plan>
Remove a plan without recording outcome.
Sourcepub fn active_plans(&self) -> Vec<&Plan>
pub fn active_plans(&self) -> Vec<&Plan>
Get all active plans.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Number of active plans.
Sourcepub fn prune_inactive_goals(&mut self, active_goal_ids: &HashSet<u32>) -> usize
pub fn prune_inactive_goals(&mut self, active_goal_ids: &HashSet<u32>) -> usize
Prune plans for goals that are no longer active.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PlanStore
impl<'de> Deserialize<'de> for PlanStore
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
Auto Trait Implementations§
impl Freeze for PlanStore
impl RefUnwindSafe for PlanStore
impl Send for PlanStore
impl Sync for PlanStore
impl Unpin for PlanStore
impl UnsafeUnpin for PlanStore
impl UnwindSafe for PlanStore
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