LookupStrategy

Trait LookupStrategy 

Source
pub trait LookupStrategy:
    Clone
    + Send
    + Sync {
    // Required methods
    fn config_subdir(&self) -> &'static str;
    fn matches_entry(&self, path: &Path) -> bool;
    fn find_by_name(&self, dir: &Path, name: &str) -> Option<PathBuf>;
}
Expand description

Trait for defining file lookup strategies.

Different item types may have different file naming conventions. For example, skills use SKILL.md in subdirectories or *.skill.md, while subagents use simple *.md files.

Required Methods§

Source

fn config_subdir(&self) -> &'static str

Get the subdirectory name within .claude/ for this item type. e.g., “skills” or “agents”

Source

fn matches_entry(&self, path: &Path) -> bool

Check if a directory entry matches the lookup pattern.

Source

fn find_by_name(&self, dir: &Path, name: &str) -> Option<PathBuf>

Try to find a file for a specific item name in a directory. Returns the file path if found, None otherwise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§