pub struct PatternStore { /* private fields */ }Expand description
Store for managing mur patterns.
Implementations§
Source§impl PatternStore
impl PatternStore
Sourcepub fn default_dir() -> PathBuf
pub fn default_dir() -> PathBuf
Get the default patterns directory (~/.mur/patterns/).
Sourcepub fn load_pattern(&self, path: &Path) -> Result<Pattern>
pub fn load_pattern(&self, path: &Path) -> Result<Pattern>
Load a single pattern from a YAML file.
Sourcepub fn get_matching_patterns(
&self,
action_type: &str,
action_command: &str,
) -> Result<Vec<Pattern>>
pub fn get_matching_patterns( &self, action_type: &str, action_command: &str, ) -> Result<Vec<Pattern>>
Get patterns that should be injected for a given action.
NOTE: Glob matching intentionally delegates to super::rules::pattern_matches
rather than implementing its own glob logic. This keeps glob matching
centralized in a single function (rules::pattern_matches) to avoid
duplicated and potentially divergent matching behavior.
Sourcepub fn format_context(
&self,
action_type: &str,
action_command: &str,
) -> Result<Option<String>>
pub fn format_context( &self, action_type: &str, action_command: &str, ) -> Result<Option<String>>
Format matching patterns as context text for AI model injection.
Sourcepub fn save_pattern(&self, pattern: &Pattern) -> Result<()>
pub fn save_pattern(&self, pattern: &Pattern) -> Result<()>
Save a pattern to the patterns directory.
Sourcepub fn remove_pattern(&self, id: &str) -> Result<bool>
pub fn remove_pattern(&self, id: &str) -> Result<bool>
Remove a pattern by ID.
Auto Trait Implementations§
impl !Freeze for PatternStore
impl RefUnwindSafe for PatternStore
impl Send for PatternStore
impl Sync for PatternStore
impl Unpin for PatternStore
impl UnsafeUnpin for PatternStore
impl UnwindSafe for PatternStore
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