pub struct Apple { /* private fields */ }Expand description
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::base_strategy::Apple;
use etcetera::base_strategy::BaseStrategy;
use std::path::Path;
let base_strategy = Apple::new().unwrap();
let home_dir = etcetera::home_dir().unwrap();
assert_eq!(
base_strategy.home_dir(),
&home_dir
);
assert_eq!(
base_strategy.config_dir().strip_prefix(&home_dir),
Ok(Path::new("Library/Preferences/"))
);
assert_eq!(
base_strategy.data_dir().strip_prefix(&home_dir),
Ok(Path::new("Library/Application Support/"))
);
assert_eq!(
base_strategy.cache_dir().strip_prefix(&home_dir),
Ok(Path::new("Library/Caches/"))
);
assert_eq!(
base_strategy.state_dir(),
None
);
assert_eq!(
base_strategy.runtime_dir(),
None
);Implementations§
Trait Implementations§
Source§impl BaseStrategy for Apple
impl BaseStrategy for Apple
Source§impl Ord for Apple
impl Ord for Apple
Source§impl PartialOrd for Apple
impl PartialOrd for Apple
impl Eq for Apple
impl StructuralPartialEq for Apple
Auto Trait Implementations§
impl Freeze for Apple
impl RefUnwindSafe for Apple
impl Send for Apple
impl Sync for Apple
impl Unpin for Apple
impl UnwindSafe for Apple
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more