pub struct NoopFsBackend;Expand description
A no-op fs backend for testing only. All methods return FsError::NotPermitted,
allowing test scenarios that require Arc<dyn FsBackend> (without actually running fs
tools) to skip setup.
In production, use defect_tools::fs::LocalFsBackend or
defect_acp::fs::AcpFsBackend.
Trait Implementations§
Source§impl FsBackend for NoopFsBackend
impl FsBackend for NoopFsBackend
Source§fn read_text(
&self,
_path: PathBuf,
_line: Option<u32>,
_limit: Option<u32>,
) -> BoxFuture<'_, Result<String, FsError>>
fn read_text( &self, _path: PathBuf, _line: Option<u32>, _limit: Option<u32>, ) -> BoxFuture<'_, Result<String, FsError>>
Reads the entire file as UTF-8 text. Read more
Source§fn write_text(
&self,
_path: PathBuf,
_content: String,
) -> BoxFuture<'_, Result<(), FsError>>
fn write_text( &self, _path: PathBuf, _content: String, ) -> BoxFuture<'_, Result<(), FsError>>
Write a UTF-8 text file, overwriting any existing content. Read more
Source§fn read_bytes(&self, path: PathBuf) -> BoxFuture<'_, Result<Vec<u8>, FsError>>
fn read_bytes(&self, path: PathBuf) -> BoxFuture<'_, Result<Vec<u8>, FsError>>
Reads the raw bytes of an entire file. The
read_file tool takes this path when
it detects a binary type such as an image, passing the bytes to the caller for
base64 encoding into a multimodal tool_result. Read moreSource§fn fingerprint(
&self,
path: PathBuf,
) -> BoxFuture<'_, Result<Fingerprint, FsError>>
fn fingerprint( &self, path: PathBuf, ) -> BoxFuture<'_, Result<Fingerprint, FsError>>
Returns a “content fingerprint” used by
edit_file to detect concurrent write
conflicts in the read–modify–write window. Read moreAuto Trait Implementations§
impl Freeze for NoopFsBackend
impl RefUnwindSafe for NoopFsBackend
impl Send for NoopFsBackend
impl Sync for NoopFsBackend
impl Unpin for NoopFsBackend
impl UnsafeUnpin for NoopFsBackend
impl UnwindSafe for NoopFsBackend
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