pub struct CliBinding {
pub program: PathBuf,
pub base_args: Vec<String>,
pub args_mapper: fn(&Value) -> Vec<String>,
}Expand description
Spawn a subprocess to realize the tool. Demonstrates that dispatch can
route a single tool_id to an external program without the Tool impl
carrying the execution logic.
args_mapper is a function pointer (not a closure) so CliBinding stays
Send + Sync without interior mutability. SP-12 ships one mapper
(ref:external.uname); a future refactor can swap this for a trait
object if more than one CLI-backed tool needs configuration.
Fields§
§program: PathBuf§base_args: Vec<String>§args_mapper: fn(&Value) -> Vec<String>Trait Implementations§
Source§impl Binding for CliBinding
impl Binding for CliBinding
fn name(&self) -> &'static str
fn call<'a>( &'a self, _tool_def: &'a ToolDefinition, args: Value, ctx: &'a CallContext, ) -> BindingFuture<'a>
Auto Trait Implementations§
impl Freeze for CliBinding
impl RefUnwindSafe for CliBinding
impl Send for CliBinding
impl Sync for CliBinding
impl Unpin for CliBinding
impl UnsafeUnpin for CliBinding
impl UnwindSafe for CliBinding
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