pub trait StorageBackend: Debug {
// Required methods
fn ensure(&self, spec: &StorageSpec) -> Result<(), ZigError>;
fn listing(&self, spec: &StorageSpec) -> Result<StorageListing, ZigError>;
fn abs_path(&self, spec: &StorageSpec) -> PathBuf;
}Expand description
Abstraction over a storage backend. Implementations decide how to
materialise a StorageSpec and how to enumerate its contents.
Required Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.