pub struct Edit {
pub workspace: Arc<dyn Workspace>,
pub base: Option<PathBuf>,
pub confine: bool,
pub seen: Seen,
}Expand description
Replaces text in a file. Publishes the file it changed
(FilesChanged): its resolved path, and the
whole diff.
Fields§
§workspace: Arc<dyn Workspace>Where the file is edited.
base: Option<PathBuf>The directory a relative path is edited in; None is the
workspace’s working directory.
confine: boolWhether a path that resolves outside base is refused, before
anything is read.
seen: SeenThe files Read showed and edits left, shared with
it: an old_text not found asks for a new read only of a file that
changed since, and an edit of a file seen whole is made from that
text, in one write_if.
Trait Implementations§
Source§impl Tool for Edit
impl Tool for Edit
Source§type Error = ToolExecutionError
type Error = ToolExecutionError
Typed error returned by direct calls to this tool. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Model-facing description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for arguments.
Source§fn annotations(&self) -> ToolAnnotations
fn annotations(&self) -> ToolAnnotations
What calling the tool does to the world, for the host’s policies
(approval, plan mode, which calls run side by side). Nothing is
stated by default, which reads as the protocol’s defaults
(
ToolAnnotations).Source§fn footprint(&self, args: &EditArgs) -> Touches
fn footprint(&self, args: &EditArgs) -> Touches
What a call with
args may read and change, so a host runs the
calls of one reply that touch different things side by side. The
default reads it from the annotations: a
read-only tool reads anything, any other writes anything.Source§async fn call(
&self,
context: &mut ToolContext,
args: EditArgs,
) -> Result<String, ToolExecutionError>
async fn call( &self, context: &mut ToolContext, args: EditArgs, ) -> Result<String, ToolExecutionError>
Execute the tool.
Auto Trait Implementations§
impl !RefUnwindSafe for Edit
impl !UnwindSafe for Edit
impl Freeze for Edit
impl Send for Edit
impl Sync for Edit
impl Unpin for Edit
impl UnsafeUnpin for Edit
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