[−][src]Struct etcetera::app_strategy::Apple
This is the strategy created by Apple for use on macOS and iOS devices. It is always used by GUI apps on macOS, and is sometimes used by command-line applications there too. iOS only has GUIs, so all iOS applications follow this strategy. The specification is available here.
use etcetera::app_strategy::AppStrategy; use etcetera::app_strategy::AppStrategyArgs; use etcetera::app_strategy::Apple; use std::path::Path; let app_strategy = Apple::new(AppStrategyArgs { top_level_domain: "com".to_string(), author: "Apple".to_string(), app_name: "Safari".to_string(), }).unwrap(); let home_dir = etcetera::home_dir().unwrap(); assert_eq!( app_strategy.config_dir().strip_prefix(&home_dir), Ok(Path::new("Library/Preferences/com.apple.Safari/") )); assert_eq!( app_strategy.data_dir().strip_prefix(&home_dir), Ok(Path::new("Library/Application Support/com.apple.Safari/") )); assert_eq!( app_strategy.cache_dir().strip_prefix(&home_dir), Ok(Path::new("Library/Caches/com.apple.Safari/") ));
Trait Implementations
impl AppStrategy for Apple
[src]
type CreationError = HomeDirError
The error type returned by new
.
fn new(args: AppStrategyArgs) -> Result<Self, Self::CreationError>
[src]
fn config_dir(&self) -> PathBuf
[src]
fn data_dir(&self) -> PathBuf
[src]
fn cache_dir(&self) -> PathBuf
[src]
fn config_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf
[src]
fn data_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf
[src]
fn cache_file<FileName: AsRef<OsStr>>(&self, file_name: FileName) -> PathBuf
[src]
impl Debug for Apple
[src]
Auto Trait Implementations
impl RefUnwindSafe for Apple
impl Send for Apple
impl Sync for Apple
impl Unpin for Apple
impl UnwindSafe for Apple
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,