#[non_exhaustive]pub struct Paths {
pub data_dir: PathBuf,
pub config_path: PathBuf,
pub db_path: PathBuf,
pub blobs_dir: PathBuf,
}Expand description
Resolved on-disk locations for the Halfhand data directory.
#[non_exhaustive]: already only ever built via Paths::resolve /
Paths::with_data_dir, never a struct literal; this just makes that the
enforced contract so a future resolved path is additive.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.data_dir: PathBufThe data directory itself ($XDG_DATA_HOME/halfhand by default).
config_path: PathBufThe config file ($XDG_CONFIG_HOME/halfhand/config.toml).
db_path: PathBufThe SQLite database file (<data_dir>/hh.db).
blobs_dir: PathBufThe blob store root (<data_dir>/blobs).
Implementations§
Source§impl Paths
impl Paths
Sourcepub fn resolve(config: &Config) -> Result<Self>
pub fn resolve(config: &Config) -> Result<Self>
Resolve paths from a loaded Config and the process environment.
Precedence (SRS §2.3): HH_DATA_DIR env > [storage] data_dir file >
platform default. The config file location is always the platform
default (not overridable via config, only via XDG_CONFIG_HOME).
Sourcepub fn with_data_dir(data_dir: PathBuf) -> Self
pub fn with_data_dir(data_dir: PathBuf) -> Self
Construct paths with an explicit data directory (used by tests so they never touch the real data directory, per CLAUDE.md testing standards).
Trait Implementations§
impl Eq for Paths
impl StructuralPartialEq for Paths
Auto Trait Implementations§
impl Freeze for Paths
impl RefUnwindSafe for Paths
impl Send for Paths
impl Sync for Paths
impl Unpin for Paths
impl UnsafeUnpin for Paths
impl UnwindSafe for Paths
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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
key and return true if they are equal.