pub struct EmbeddedSkill { /* private fields */ }Expand description
An in-memory skill built from static content.
Implements Skill directly. Constructed via EmbeddedSkill::new which
parses and validates the SKILL.md at construction time.
Implementations§
Source§impl EmbeddedSkill
impl EmbeddedSkill
Sourcepub fn new(data: &EmbeddedSkillData) -> Result<EmbeddedSkill, SkillError>
pub fn new(data: &EmbeddedSkillData) -> Result<EmbeddedSkill, SkillError>
Build an embedded skill from static data.
Parses and validates the SKILL.md content. Returns an error if the content is invalid or if base64 asset decoding fails.
Sourcepub fn from_static_slice(
data: &[EmbeddedSkillData],
) -> Result<Vec<Arc<dyn Skill>>, SkillError>
pub fn from_static_slice( data: &[EmbeddedSkillData], ) -> Result<Vec<Arc<dyn Skill>>, SkillError>
Construct multiple embedded skills from static data, collecting into trait objects.
Trait Implementations§
Source§impl Clone for EmbeddedSkill
impl Clone for EmbeddedSkill
Source§fn clone(&self) -> EmbeddedSkill
fn clone(&self) -> EmbeddedSkill
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 EmbeddedSkill
impl Debug for EmbeddedSkill
Source§impl Skill for EmbeddedSkill
impl Skill for EmbeddedSkill
Source§fn read_instructions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, SkillError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EmbeddedSkill: 'async_trait,
fn read_instructions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, SkillError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EmbeddedSkill: 'async_trait,
Read the raw SKILL.md content.
Source§fn load_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
kind: SkillResourceKind,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SkillResource, SkillError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
EmbeddedSkill: 'async_trait,
fn load_resource<'life0, 'life1, 'async_trait>(
&'life0 self,
kind: SkillResourceKind,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SkillResource, SkillError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
EmbeddedSkill: 'async_trait,
Load a resource (reference or asset) by relative path.
Source§fn run_script<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
script: &'life1 str,
_args: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<ScriptResult, SkillError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
EmbeddedSkill: 'async_trait,
fn run_script<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
script: &'life1 str,
_args: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<ScriptResult, SkillError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
EmbeddedSkill: 'async_trait,
Run a script by relative path with arguments.
Auto Trait Implementations§
impl Freeze for EmbeddedSkill
impl RefUnwindSafe for EmbeddedSkill
impl Send for EmbeddedSkill
impl Sync for EmbeddedSkill
impl Unpin for EmbeddedSkill
impl UnwindSafe for EmbeddedSkill
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