Skip to main content

StorePaths

Struct StorePaths 

Source
pub struct StorePaths { /* private fields */ }
Expand description

Path-builder for the zenith local store rooted at a data directory.

All methods are pure: they compute a PathBuf via Path::join and return it without touching the filesystem.

Implementations§

Source§

impl StorePaths

Source

pub fn new(data_dir: impl Into<PathBuf>) -> Self

Create a new StorePaths rooted at data_dir.

Source

pub fn docs_root(&self) -> PathBuf

The root directory holding all per-document history: <root>/docs.

Source

pub fn doc_dir(&self, doc_id: &str) -> PathBuf

Directory that contains all data for a given document.

<root>/docs/<doc_id>

Source

pub fn objects_dir(&self, doc_id: &str) -> PathBuf

Directory that holds immutable object blobs for a document.

<root>/docs/<doc_id>/objects

Source

pub fn versions_file(&self, doc_id: &str) -> PathBuf

Append-only version manifest file for a document.

<root>/docs/<doc_id>/versions.jsonl

Source

pub fn session_dir(&self, doc_id: &str) -> PathBuf

Mutable local session state directory for a document.

<root>/docs/<doc_id>/session

Source

pub fn meta_file(&self, doc_id: &str) -> PathBuf

Persisted per-doc metadata file.

<root>/docs/<doc_id>/meta.json

Source

pub fn runs_file(&self, doc_id: &str) -> PathBuf

Append-only agent-runs log: <root>/docs/<doc_id>/runs.jsonl.

Source

pub fn previews_file(&self, doc_id: &str) -> PathBuf

Append-only preview-artifacts log: <root>/docs/<doc_id>/previews.jsonl.

Source

pub fn scratch_dir(&self, doc_id: &str) -> PathBuf

Scratch/candidate directory: <root>/docs/<doc_id>/scratch.

Source

pub fn scratch_index(&self, doc_id: &str) -> PathBuf

Scratch/candidate index: <root>/docs/<doc_id>/scratch/index.jsonl.

Source

pub fn workspace_dir(&self, doc_id: &str) -> PathBuf

Per-document workspace directory for ephemeral working artifacts that are NOT part of the deliverable .zen: <root>/docs/<doc_id>/workspace.

Source

pub fn workspace_renders_dir(&self, doc_id: &str) -> PathBuf

Predictable scratch area for rendered previews produced via the agent (MCP) surface: <root>/docs/<doc_id>/workspace/renders.

Keeping previews here means the .zen holds only final content while the agent still has one stable, per-document place to find its render output.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.