pub struct StorePaths { /* private fields */ }Expand description
Layout of the store on disk.
Implementations§
Source§impl StorePaths
impl StorePaths
pub fn new(root: impl Into<PathBuf>) -> Self
Sourcepub fn resolve(
flag: Option<&Path>,
configured: Option<&Path>,
) -> Result<Self, Error>
pub fn resolve( flag: Option<&Path>, configured: Option<&Path>, ) -> Result<Self, Error>
Resolve the store root: --data-dir beats config, config beats
~/.warden.
pub fn root(&self) -> &Path
pub fn events_dir(&self) -> PathBuf
pub fn prompts_dir(&self) -> PathBuf
pub fn state_dir(&self) -> PathBuf
pub fn config_file(&self) -> PathBuf
Sourcepub fn ingest_state_file(&self) -> PathBuf
pub fn ingest_state_file(&self) -> PathBuf
state/ingest.jsonl — append-only cursors, last record per path wins.
Sourcepub fn event_partition(&self, partition: Partition) -> PathBuf
pub fn event_partition(&self, partition: Partition) -> PathBuf
events/YYYY-MM.jsonl for the partition an event timestamp belongs to.
Sourcepub fn prompt_partition(&self, partition: Partition) -> PathBuf
pub fn prompt_partition(&self, partition: Partition) -> PathBuf
prompts/YYYY-MM.jsonl, partitioned identically to events.
Sourcepub fn partitions_in(
dir: &Path,
window: TimeWindow,
) -> Result<Vec<(Partition, PathBuf)>, Error>
pub fn partitions_in( dir: &Path, window: TimeWindow, ) -> Result<Vec<(Partition, PathBuf)>, Error>
Partition files in dir overlapping window, chronologically.
events/ and prompts/ are partitioned identically, so the overlap rule
lives here once: both the event scanner and the prompt reader call this
rather than each deciding for itself what “overlaps” means.
A missing directory is an empty store, not an error.
Trait Implementations§
Source§impl Clone for StorePaths
impl Clone for StorePaths
Source§fn clone(&self) -> StorePaths
fn clone(&self) -> StorePaths
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StorePaths
impl Debug for StorePaths
impl Eq for StorePaths
Source§impl PartialEq for StorePaths
impl PartialEq for StorePaths
impl StructuralPartialEq for StorePaths
Auto Trait Implementations§
impl Freeze for StorePaths
impl RefUnwindSafe for StorePaths
impl Send for StorePaths
impl Sync for StorePaths
impl Unpin for StorePaths
impl UnsafeUnpin for StorePaths
impl UnwindSafe for StorePaths
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.