pub struct FilesystemBackend { /* private fields */ }Expand description
Filesystem-backed storage rooted at <cwd>/.zig/.
Implementations§
Source§impl FilesystemBackend
impl FilesystemBackend
Sourcepub fn new(zig_root: PathBuf) -> Self
pub fn new(zig_root: PathBuf) -> Self
Create a backend rooted at the given directory. The directory is
created on demand during StorageBackend::ensure; it does not
need to exist yet.
Sourcepub fn from_cwd() -> Result<Self, ZigError>
pub fn from_cwd() -> Result<Self, ZigError>
Build a backend rooted at <cwd>/.zig/ using the process’s current
working directory. Use FilesystemBackend::new in tests so you
can pin the root to a tempdir.
Trait Implementations§
Source§impl Clone for FilesystemBackend
impl Clone for FilesystemBackend
Source§fn clone(&self) -> FilesystemBackend
fn clone(&self) -> FilesystemBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FilesystemBackend
impl Debug for FilesystemBackend
Source§impl StorageBackend for FilesystemBackend
impl StorageBackend for FilesystemBackend
Source§fn ensure(&self, spec: &StorageSpec) -> Result<(), ZigError>
fn ensure(&self, spec: &StorageSpec) -> Result<(), ZigError>
Ensure the storage item exists and is ready for reads/writes.
Called once per run before any step executes. Must be idempotent.
Source§fn listing(&self, spec: &StorageSpec) -> Result<StorageListing, ZigError>
fn listing(&self, spec: &StorageSpec) -> Result<StorageListing, ZigError>
Enumerate the current contents of the storage item. Called each
time a step’s system prompt is rendered so the listing reflects
files written by previous steps in the same run.
Source§fn abs_path(&self, spec: &StorageSpec) -> PathBuf
fn abs_path(&self, spec: &StorageSpec) -> PathBuf
Absolute on-disk path for the storage item. This is what gets
embedded in the agent’s system prompt so it can read/write with
its normal file tools.
Auto Trait Implementations§
impl Freeze for FilesystemBackend
impl RefUnwindSafe for FilesystemBackend
impl Send for FilesystemBackend
impl Sync for FilesystemBackend
impl Unpin for FilesystemBackend
impl UnsafeUnpin for FilesystemBackend
impl UnwindSafe for FilesystemBackend
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