pub trait BaseStrategy: Sized {
type CreationError: Error;
// Required methods
fn new() -> Result<Self, Self::CreationError>;
fn home_dir(&self) -> &Path;
fn config_dir(&self) -> PathBuf;
fn data_dir(&self) -> PathBuf;
fn cache_dir(&self) -> PathBuf;
fn state_dir(&self) -> Option<PathBuf>;
fn runtime_dir(&self) -> Option<PathBuf>;
}
Expand description
Provides configuration, data, and cache directories of the current user.
Required Associated Types§
Sourcetype CreationError: Error
type CreationError: Error
The error type returned by new
.
Required Methods§
Sourcefn new() -> Result<Self, Self::CreationError>
fn new() -> Result<Self, Self::CreationError>
Base strategies are constructed without knowledge of the application.
Sourcefn config_dir(&self) -> PathBuf
fn config_dir(&self) -> PathBuf
Gets the user’s configuration directory.
Sourcefn state_dir(&self) -> Option<PathBuf>
fn state_dir(&self) -> Option<PathBuf>
Gets the user’s state directory. State directory may not exist for all conventions.
Sourcefn runtime_dir(&self) -> Option<PathBuf>
fn runtime_dir(&self) -> Option<PathBuf>
Gets the user’s runtime directory. Runtime directory may not exist for all conventions.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.