pub struct PlanIndex { /* private fields */ }Expand description
Manage the plans-index.json file for plan-session-project tracking.
Implementations§
Source§impl PlanIndex
impl PlanIndex
Sourcepub fn new(plans_dir: impl Into<PathBuf>) -> Self
pub fn new(plans_dir: impl Into<PathBuf>) -> Self
Create a new plan index manager.
§Arguments
plans_dir- Directory containing plan files (e.g.~/.opendev/plans/).
Sourcepub fn add_entry(
&self,
name: &str,
session_id: Option<&str>,
project_path: Option<&str>,
)
pub fn add_entry( &self, name: &str, session_id: Option<&str>, project_path: Option<&str>, )
Add or update an entry in the plan index.
If an entry with the same name already exists, it is replaced (upsert).
Sourcepub fn get_by_session(&self, session_id: &str) -> Option<PlanEntry>
pub fn get_by_session(&self, session_id: &str) -> Option<PlanEntry>
Look up a plan entry by session ID.
Sourcepub fn get_by_project(&self, project_path: &str) -> Vec<PlanEntry>
pub fn get_by_project(&self, project_path: &str) -> Vec<PlanEntry>
List all plan entries for a project.
Sourcepub fn remove_entry(&self, name: &str)
pub fn remove_entry(&self, name: &str)
Remove an entry by plan name.
Auto Trait Implementations§
impl Freeze for PlanIndex
impl RefUnwindSafe for PlanIndex
impl Send for PlanIndex
impl Sync for PlanIndex
impl Unpin for PlanIndex
impl UnsafeUnpin for PlanIndex
impl UnwindSafe for PlanIndex
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