pub struct ToolCtx {
pub cwd: PathBuf,
pub read_files: Arc<Mutex<HashSet<PathBuf>>>,
pub permission_gate: Arc<dyn PermissionGate>,
pub progress_tx: Sender<ToolProgressChunk>,
pub cancel_token: SharedCancelToken,
}Fields§
§cwd: PathBuf§read_files: Arc<Mutex<HashSet<PathBuf>>>§permission_gate: Arc<dyn PermissionGate>§progress_tx: Sender<ToolProgressChunk>§cancel_token: SharedCancelTokenImplementations§
Source§impl ToolCtx
impl ToolCtx
pub fn new( cwd: impl AsRef<Path>, permission_gate: Arc<dyn PermissionGate>, progress_tx: Sender<ToolProgressChunk>, ) -> Self
pub fn new_with_cancel_token( cwd: impl AsRef<Path>, permission_gate: Arc<dyn PermissionGate>, progress_tx: Sender<ToolProgressChunk>, cancel_token: SharedCancelToken, ) -> Self
Sourcepub async fn mark_read(&self, path: &Path)
pub async fn mark_read(&self, path: &Path)
Record a file as read for this session.
Callers should store the canonicalized path whenever possible so later
stale-read guards (edit / write in future milestones) can do a
canonical-path lookup without alias mismatches.
pub async fn has_been_read(&self, path: &Path) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolCtx
impl !RefUnwindSafe for ToolCtx
impl Send for ToolCtx
impl Sync for ToolCtx
impl Unpin for ToolCtx
impl UnsafeUnpin for ToolCtx
impl !UnwindSafe for ToolCtx
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