pub struct ToolContext {
pub workdir: PathBuf,
/* private fields */
}Expand description
Context for tool execution - defines the sandbox root.
Fields§
§workdir: PathBufAbsolute working directory. All file operations are confined here.
Implementations§
Source§impl ToolContext
impl ToolContext
Sourcepub fn new(workdir: PathBuf) -> Self
pub fn new(workdir: PathBuf) -> Self
Create a new context. Attempts to canonicalize the working directory.
Sourcepub fn with_read_paths(self, policy: ReadPathPolicy) -> Self
pub fn with_read_paths(self, policy: ReadPathPolicy) -> Self
Attach a [read_paths] policy resolved at spawn. Builder-style, like
BuiltinTools::with_shell_executor.
Sourcepub fn with_shell_env(self, policy: ShellEnvPolicy) -> Self
pub fn with_shell_env(self, policy: ShellEnvPolicy) -> Self
Attach the [security] shell_env decision resolved at spawn.
Auto Trait Implementations§
impl Freeze for ToolContext
impl RefUnwindSafe for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl UnsafeUnpin for ToolContext
impl UnwindSafe for ToolContext
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