pub struct SkillDescriptor {
pub name: String,
pub provides: Vec<Capability>,
}Expand description
What a skill is and what it promises.
Fields§
§name: String§provides: Vec<Capability>The capabilities declared with provides.
Empty means the skill’s name is the capability — see
capabilities, which is what the runtime reads.
The name/capability split earns its keep in a plan graph, where one
skill answers an abstract capability another agent names; a hello-world
program should not have to invent two names for one thing.
Implementations§
Source§impl SkillDescriptor
impl SkillDescriptor
pub fn new(name: impl Into<String>) -> Self
pub fn provides(self, cap: impl Into<Capability>) -> Self
Sourcepub fn capabilities(&self) -> Vec<Capability>
pub fn capabilities(&self) -> Vec<Capability>
The capabilities this skill answers: what it declared, or its own name.
Never empty. Declaring a capability replaces the name default
rather than adding to it, so a skill that provides demo.greet is not
also silently reachable as greet — one declared surface, not two.
Trait Implementations§
Source§impl Clone for SkillDescriptor
impl Clone for SkillDescriptor
Source§fn clone(&self) -> SkillDescriptor
fn clone(&self) -> SkillDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SkillDescriptor
impl Debug for SkillDescriptor
Source§impl<'de> Deserialize<'de> for SkillDescriptor
impl<'de> Deserialize<'de> for SkillDescriptor
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 SkillDescriptor
Source§impl PartialEq for SkillDescriptor
impl PartialEq for SkillDescriptor
Source§impl Serialize for SkillDescriptor
impl Serialize for SkillDescriptor
impl StructuralPartialEq for SkillDescriptor
Auto Trait Implementations§
impl Freeze for SkillDescriptor
impl RefUnwindSafe for SkillDescriptor
impl Send for SkillDescriptor
impl Sync for SkillDescriptor
impl Unpin for SkillDescriptor
impl UnsafeUnpin for SkillDescriptor
impl UnwindSafe for SkillDescriptor
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.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.