pub struct AppPath { /* private fields */ }
Expand description
Creates paths relative to the executable location for applications. All files and directories stay together with the executable.
Implementations§
Source§impl AppPath
impl AppPath
Sourcepub fn new(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn new(path: impl AsRef<Path>) -> Result<Self, Error>
Creates file paths relative to the executable location.
Sourcepub fn with_base(self, base: impl AsRef<Path>) -> Self
pub fn with_base(self, base: impl AsRef<Path>) -> Self
Override the base directory (useful for testing or custom layouts)
Sourcepub fn create_dir_all(&self) -> Result<()>
pub fn create_dir_all(&self) -> Result<()>
Create parent directories if they don’t exist
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppPath
impl RefUnwindSafe for AppPath
impl Send for AppPath
impl Sync for AppPath
impl Unpin for AppPath
impl UnwindSafe for AppPath
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