pub struct FsSkillResolver { /* private fields */ }Expand description
Filesystem-backed SkillResolver over a .claude/skills/ directory.
Why: Gives the tool-registry layer (the use_skill tool) a ready
concrete resolver: metadata is discovered once at construction (cheap,
cached); resolve reads a single skill’s body lazily, on demand.
What: Wraps skills_dir plus the metadata discovered from it at
construction time. metadata()/list() return the cached catalog;
resolve() calls load_skill_body per invocation.
Test: fs_skill_resolver_resolves_known_skill,
fs_skill_resolver_list_matches_metadata_names,
fs_skill_resolver_resolve_unknown_returns_none.
Implementations§
Source§impl FsSkillResolver
impl FsSkillResolver
Sourcepub fn new(skills_dir: impl Into<PathBuf>) -> Self
pub fn new(skills_dir: impl Into<PathBuf>) -> Self
Construct a resolver, eagerly discovering (cheap) metadata.
Why: Metadata discovery is a directory scan plus frontmatter parsing
only — cheap enough to do once at construction so every later
metadata()/list() call is a clone of an in-memory Vec.
What: Calls discover_skill_metadata(&skills_dir) and stores both.
Test: fs_skill_resolver_resolves_known_skill.
Trait Implementations§
Source§impl SkillResolver for FsSkillResolver
impl SkillResolver for FsSkillResolver
Auto Trait Implementations§
impl Freeze for FsSkillResolver
impl RefUnwindSafe for FsSkillResolver
impl Send for FsSkillResolver
impl Sync for FsSkillResolver
impl Unpin for FsSkillResolver
impl UnsafeUnpin for FsSkillResolver
impl UnwindSafe for FsSkillResolver
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more