Struct jarida::Config[][src]

pub struct Config {
    pub temp_dir: Option<PathBuf>,
    pub journal_dir: Option<PathBuf>,
    pub editor: PathBuf,
    pub user: Option<String>,
    pub password: Option<String>,
}

Fields

temp_dir: Option<PathBuf>

The temporary work directory

journal_dir: Option<PathBuf>

The directory to save all journal data in

editor: PathBuf

The path to the user’s editor of choice

user: Option<String>

The name of the user

password: Option<String>

Password

Implementations

impl Config[src]

pub const DIR_NAME: &'static str[src]

The name of the configuration directory.

pub const FILE_NAME: &'static str[src]

The name of the configuration file.

pub fn find() -> Result<Config>[src]

Find the configuration file and parse it.

Returns an error if the file cannot be found or is invalid/malformed.

pub fn find_config_file_path() -> Result<PathBuf>[src]

Try to find the config file, first in a parent directory, then in the user’s home directory. The file may not exist.

An error is returned if the configuration directory cannot be found.

pub fn find_config_dir_path() -> Result<PathBuf>[src]

Try to find the config directory, first in a parent directory, then in the user’s home directory. If the directory cannot be found an error is returned/

pub fn get_user_config_dir_path() -> Result<PathBuf>[src]

Get the expected path to the config direcotry in the user’s home directory.

The file may not exist. If the user’s home directory could not be found an error is returned.

pub fn data_store_path(&self) -> PathBuf[src]

Get the path to the directory containing journal data.

pub fn template() -> &'static str[src]

Get the contents of a template config.toml file.

Trait Implementations

impl Debug for Config[src]

impl<'de> Deserialize<'de> for Config[src]

impl FromStr for Config[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,