[][src]Trait etcetera::app_strategy::AppStrategy

pub trait AppStrategy: Sized {
    type CreationError;
    fn new(args: AppStrategyArgs) -> Result<Self, Self::CreationError>;
fn config_dir(&self) -> PathBuf;
fn data_dir(&self) -> PathBuf;
fn cache_dir(&self) -> PathBuf; fn config_file<FileName: AsRef<OsStr>>(
        &self,
        file_name: FileName
    ) -> PathBuf { ... }
fn data_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf { ... }
fn cache_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf { ... } }

Allows applications to retrieve the paths of configuration, data and cache directories specifically for them.

Associated Types

type CreationError

The error type returned by new.

Loading content...

Required methods

fn new(args: AppStrategyArgs) -> Result<Self, Self::CreationError>

The constructor requires access to some basic information about your application.

fn config_dir(&self) -> PathBuf

Gets the configuration directory for your application.

fn data_dir(&self) -> PathBuf

Gets the data directory for your application.

fn cache_dir(&self) -> PathBuf

Gets the cache directory for your application.

Loading content...

Provided methods

fn config_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf

Constructs a path inside your application’s configuration directory to which a file name of your choice has been appended.

fn data_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf

Constructs a path inside your application’s data directory to which a file name of your choice has been appended.

fn cache_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf

Constructs a path inside your application’s cache directory to which a file name of your choice has been appended.

Loading content...

Implementors

impl AppStrategy for Apple[src]

impl AppStrategy for Unix[src]

impl AppStrategy for Windows[src]

impl AppStrategy for Xdg[src]

Loading content...