pub struct SkillIndexLoader;Expand description
Loader for creating SkillIndex entries from files.
This loader extracts only the frontmatter metadata, creating a lightweight index entry. The full content is loaded on-demand via ContentSource.
Implementations§
Source§impl SkillIndexLoader
impl SkillIndexLoader
Sourcepub fn parse_index(&self, content: &str, path: &Path) -> Result<SkillIndex>
pub fn parse_index(&self, content: &str, path: &Path) -> Result<SkillIndex>
Parse a skill file to create a SkillIndex.
Only the frontmatter is parsed; the body is NOT loaded into memory. Instead, a ContentSource::File is created for lazy loading.
Sourcepub fn parse_frontmatter_only(
&self,
content: &str,
path: &Path,
) -> Result<SkillIndex>
pub fn parse_frontmatter_only( &self, content: &str, path: &Path, ) -> Result<SkillIndex>
Parse frontmatter only from content, returning the index.
Sourcepub async fn load_file(&self, path: &Path) -> Result<SkillIndex>
pub async fn load_file(&self, path: &Path) -> Result<SkillIndex>
Load a skill index from a file.
Sourcepub async fn scan_directory(&self, dir: &Path) -> Result<Vec<SkillIndex>>
pub async fn scan_directory(&self, dir: &Path) -> Result<Vec<SkillIndex>>
Scan a directory for skill files and create indices.
This recursively scans the directory for skill files (.skill.md or SKILL.md) and creates SkillIndex entries for each.
Sourcepub fn create_inline(
&self,
name: impl Into<String>,
description: impl Into<String>,
content: impl Into<String>,
) -> SkillIndex
pub fn create_inline( &self, name: impl Into<String>, description: impl Into<String>, content: impl Into<String>, ) -> SkillIndex
Create an inline skill index with content already available.
Trait Implementations§
Source§impl Clone for SkillIndexLoader
impl Clone for SkillIndexLoader
Source§fn clone(&self) -> SkillIndexLoader
fn clone(&self) -> SkillIndexLoader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SkillIndexLoader
impl Debug for SkillIndexLoader
Source§impl Default for SkillIndexLoader
impl Default for SkillIndexLoader
Source§fn default() -> SkillIndexLoader
fn default() -> SkillIndexLoader
Returns the “default value” for a type. Read more
impl Copy for SkillIndexLoader
Auto Trait Implementations§
impl Freeze for SkillIndexLoader
impl RefUnwindSafe for SkillIndexLoader
impl Send for SkillIndexLoader
impl Sync for SkillIndexLoader
impl Unpin for SkillIndexLoader
impl UnwindSafe for SkillIndexLoader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.