pub struct ScriptToolSet { /* private fields */ }Expand description
The set of script tools available to one agent, keyed by tool name.
Implementations§
Source§impl ScriptToolSet
impl ScriptToolSet
Sourcepub fn discover(dirs: &[PathBuf]) -> (Self, Vec<SkippedTool>)
pub fn discover(dirs: &[PathBuf]) -> (Self, Vec<SkippedTool>)
Discover and compile every *.rhai tool in dirs, in order. Earlier
directories win on a name collision (so a per-agent tools/ shadows the
global one). A file that fails to parse (bad annotations/tool.toml) or
compile is skipped and reported in the returned SkippedTool list,
never failing the whole agent. A tool.toml sitting beside
<name>.rhai overrides that script’s annotations.
Sourcepub fn get(&self, name: &str) -> Option<&ScriptTool>
pub fn get(&self, name: &str) -> Option<&ScriptTool>
Look up a compiled tool by name.
Sourcepub fn metas(&self) -> Vec<ScriptToolMeta>
pub fn metas(&self) -> Vec<ScriptToolMeta>
The metadata of every tool, for building Tool defs in the caller.
Trait Implementations§
Source§impl Clone for ScriptToolSet
impl Clone for ScriptToolSet
Source§fn clone(&self) -> ScriptToolSet
fn clone(&self) -> ScriptToolSet
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 Default for ScriptToolSet
impl Default for ScriptToolSet
Source§fn default() -> ScriptToolSet
fn default() -> ScriptToolSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ScriptToolSet
impl !UnwindSafe for ScriptToolSet
impl Freeze for ScriptToolSet
impl Send for ScriptToolSet
impl Sync for ScriptToolSet
impl Unpin for ScriptToolSet
impl UnsafeUnpin for ScriptToolSet
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