[][src]Struct etcetera::app_strategy::Unix

pub struct Unix { /* fields omitted */ }

This strategy has no standard or official specification. It has arisen over time through hundreds of Unixy tools. Vim and Cargo are notable examples whose configuration/data/cache directory layouts are similar to those created by this strategy.

use etcetera::app_strategy::AppStrategy;
use etcetera::app_strategy::AppStrategyArgs;
use etcetera::app_strategy::Unix;
use std::path::Path;

let app_strategy = Unix::new(AppStrategyArgs {
    top_level_domain: "org".to_string(),
    author: "Bram Moolenar".to_string(),
    app_name: "Vim".to_string(),
}).unwrap();

let home_dir = etcetera::home_dir().unwrap();

assert_eq!(
    app_strategy.config_dir().strip_prefix(&home_dir),
    Ok(Path::new(".vim/")
));
assert_eq!(
    app_strategy.data_dir().strip_prefix(&home_dir),
    Ok(Path::new(".vim/data/")
));
assert_eq!(
    app_strategy.cache_dir().strip_prefix(&home_dir),
    Ok(Path::new(".vim/cache/")
));

Trait Implementations

impl AppStrategy for Unix[src]

type CreationError = HomeDirError

The error type returned by new.

impl Debug for Unix[src]

Auto Trait Implementations

impl RefUnwindSafe for Unix

impl Send for Unix

impl Sync for Unix

impl Unpin for Unix

impl UnwindSafe for Unix

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> 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.