#[non_exhaustive]pub enum SkillError {
InvalidFrontmatter(String),
InvalidName(String),
InvalidDescription(String),
NameMismatch {
name: String,
dir: String,
},
NotFound(String),
InvalidBody(String),
Io(String),
}Expand description
Reasons a skill parse / load fails.
#[non_exhaustive] ensures future error categories are not breaking
changes; external crates should match with a wildcard arm. The error
type is well-behaved: the Io variant carries stringified error text
(io::Error itself is not Clone; stringifying keeps Clone + PartialEq).
§Example
use molo::skill::SkillError;
let err = SkillError::InvalidName("name may only contain lowercase letters, digits, and hyphens".into());
assert!(err.to_string().contains("name"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidFrontmatter(String)
frontmatter structural errors: missing delimiters, syntax errors,
unsupported nested structures, an over-long compatibility, etc.
InvalidName(String)
name missing or not conforming to kebab-case rules.
InvalidDescription(String)
description missing, empty, or over 1024 characters.
NameMismatch
During directory loading, the skill name does not match the directory name.
NotFound(String)
Target not found: no SKILL.md in the directory, resource missing, or a text-parsed skill without a resource directory.
InvalidBody(String)
Body too long (limit in MAX_SKILL_BODY_CHARS): the body is
recorded as protected resident context and must not grow unbounded.
Io(String)
Filesystem error (stringified; the error is already fully expressed as text).
Trait Implementations§
Source§impl Clone for SkillError
impl Clone for SkillError
Source§fn clone(&self) -> SkillError
fn clone(&self) -> SkillError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SkillError
impl Debug for SkillError
Source§impl Display for SkillError
impl Display for SkillError
impl Eq for SkillError
Source§impl Error for SkillError
impl Error for SkillError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for SkillError
impl From<Error> for SkillError
Source§impl PartialEq for SkillError
impl PartialEq for SkillError
impl StructuralPartialEq for SkillError
Auto Trait Implementations§
impl Freeze for SkillError
impl RefUnwindSafe for SkillError
impl Send for SkillError
impl Sync for SkillError
impl Unpin for SkillError
impl UnsafeUnpin for SkillError
impl UnwindSafe for SkillError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.