pub struct ReadFile { /* private fields */ }Expand description
Read a UTF-8 text file.
Unsandboxed by default. Without ReadFile::with_sandbox this tool
can read any file the process has access to. Pair with a
FilesystemRoot when exposing to untrusted LLM output.
Implementations§
Source§impl ReadFile
impl ReadFile
Sourcepub fn new() -> Self
pub fn new() -> Self
Unsandboxed constructor — full-host read access. Use only in trusted contexts.
Sourcepub fn with_sandbox(sandbox: Arc<FilesystemRoot>) -> Self
pub fn with_sandbox(sandbox: Arc<FilesystemRoot>) -> Self
Sandboxed constructor — paths are resolved against sandbox and
rejected if they escape the root.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReadFile
impl RefUnwindSafe for ReadFile
impl Send for ReadFile
impl Sync for ReadFile
impl Unpin for ReadFile
impl UnsafeUnpin for ReadFile
impl UnwindSafe for ReadFile
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