pub struct Skill { /* private fields */ }Expand description
A skill: its frontmatter, its instructions and any further files.
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
body: impl Into<String>,
) -> Result<Self, SkillError>
pub fn new( name: impl Into<String>, description: impl Into<String>, body: impl Into<String>, ) -> Result<Self, SkillError>
A skill with a name, a description and the instructions below the frontmatter.
§Errors
Returns an error for a name the specification refuses or a description that is empty or too long.
Sourcepub fn with_field(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, SkillError>
pub fn with_field( self, key: impl Into<String>, value: impl Into<String>, ) -> Result<Self, SkillError>
Add a top-level frontmatter field, such as license.
§Errors
Returns an error for a key that is not a plain lowercase word or that the crate writes itself.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, SkillError>
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Result<Self, SkillError>
Add an entry to the metadata map, next to the ownership record.
§Errors
Returns an error for a key that is not a plain word or that belongs to the ownership record.
Trait Implementations§
impl Eq for Skill
impl StructuralPartialEq for Skill
Auto Trait Implementations§
impl Freeze for Skill
impl RefUnwindSafe for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin for Skill
impl UnwindSafe for Skill
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