pub struct SkillName(/* private fields */);Expand description
A validated skill name.
§Constraints
- Must be 1-64 characters
- May only contain lowercase alphanumeric characters and hyphens (
a-z,0-9,-) - Must not start or end with a hyphen
- Must not contain consecutive hyphens (
--)
§Examples
use agent_skills::SkillName;
let name = SkillName::new("pdf-processing").unwrap();
assert_eq!(name.as_str(), "pdf-processing");
// Invalid: uppercase
assert!(SkillName::new("PDF-Processing").is_err());
// Invalid: consecutive hyphens
assert!(SkillName::new("pdf--processing").is_err());Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SkillName
impl<'de> Deserialize<'de> for SkillName
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SkillName
impl StructuralPartialEq for SkillName
Auto Trait Implementations§
impl Freeze for SkillName
impl RefUnwindSafe for SkillName
impl Send for SkillName
impl Sync for SkillName
impl Unpin for SkillName
impl UnwindSafe for SkillName
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.