pub struct SkillsModule { /* private fields */ }Expand description
Serves skills.*. Durable mutations and snapshot installation run one at a time.
Implementations§
Source§impl SkillsModule
impl SkillsModule
pub fn new( store: Arc<dyn DocumentStore>, load_skills: SkillLoader, now: Clock, code: Option<CodeSkills>, ) -> Self
pub fn code(&self) -> Option<&CodeSkills>
Sourcepub fn handle(
&self,
kind: &str,
payload: &Map<String, Value>,
caller: Option<&str>,
signal: &Signal,
) -> Result<Value, String>
pub fn handle( &self, kind: &str, payload: &Map<String, Value>, caller: Option<&str>, signal: &Signal, ) -> Result<Value, String>
A request without a task runtime (skills.invoke is refused: nothing can spawn the skill’s task).
Sourcepub fn handle_with_host(
&self,
kind: &str,
payload: &Map<String, Value>,
caller: Option<&str>,
host: &dyn TaskHost,
signal: &Signal,
) -> Result<Value, String>
pub fn handle_with_host( &self, kind: &str, payload: &Map<String, Value>, caller: Option<&str>, host: &dyn TaskHost, signal: &Signal, ) -> Result<Value, String>
A request whose skills.invoke spawns through host.
Sourcepub fn upsert(
&self,
key: &str,
base: &Value,
change: &Value,
) -> Result<(), String>
pub fn upsert( &self, key: &str, base: &Value, change: &Value, ) -> Result<(), String>
Merge change into the record of key (a journal list of the module document) whose id is base’s, or
append base with change merged when there is none.
Sourcepub fn records(&self, key: &str) -> Result<Vec<Value>, String>
pub fn records(&self, key: &str) -> Result<Vec<Value>, String>
The records of key (a journal list of the module document), oldest first.
Sourcepub fn pinned_skill(
&self,
name: &str,
version: Option<&str>,
) -> Result<PinnedSkill, String>
pub fn pinned_skill( &self, name: &str, version: Option<&str>, ) -> Result<PinnedSkill, String>
The catalog’s name (at version, when given: an older version is refused as stale).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SkillsModule
impl !RefUnwindSafe for SkillsModule
impl !UnwindSafe for SkillsModule
impl Forget for SkillsModule
impl Move for SkillsModule
impl Send for SkillsModule
impl Sync for SkillsModule
impl Unpin for SkillsModule
impl UnsafeUnpin for SkillsModule
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