pub struct AppPaths {
pub root: Option<PathBuf>,
pub config_dir: PathBuf,
pub data_dir: PathBuf,
pub log_dir: PathBuf,
pub config_file: PathBuf,
pub database_path: PathBuf,
}Expand description
Resolved on-disk locations used by the application.
Fields§
§root: Option<PathBuf>Optional synthetic root used for tests and local overrides.
config_dir: PathBufDirectory containing config files.
data_dir: PathBufDirectory containing data files.
log_dir: PathBufDirectory containing log files.
config_file: PathBufMain config file.
database_path: PathBufSQLite database path.
Implementations§
Source§impl AppPaths
impl AppPaths
Sourcepub fn discover(database_override: Option<PathBuf>) -> Result<Self>
pub fn discover(database_override: Option<PathBuf>) -> Result<Self>
Resolve the app paths for the current environment.
Sourcepub fn ensure_exists(&self) -> Result<()>
pub fn ensure_exists(&self) -> Result<()>
Ensure the required directories exist.
Sourcepub fn config_file(&self) -> &Path
pub fn config_file(&self) -> &Path
Return the config file path as a generic path reference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppPaths
impl RefUnwindSafe for AppPaths
impl Send for AppPaths
impl Sync for AppPaths
impl Unpin for AppPaths
impl UnsafeUnpin for AppPaths
impl UnwindSafe for AppPaths
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