You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Returns the current OS’s native [`AppStrategy`](trait.AppStrategy.html).
143
139
/// This uses the [`Windows`](struct.Windows.html) strategy on Windows, [`Apple`](struct.Apple.html) on macOS & iOS, and [`Xdg`](struct.Xdg.html) everywhere else.
144
140
/// This is the convention used by most GUI applications.
Copy file name to clipboardexpand all lines: src/app_strategy/apple.rs
+6-5
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
-
usecrate::base_strategy;
2
1
usecrate::base_strategy::BaseStrategy;
2
+
usecrate::{base_strategy,HomeDirError};
3
3
use std::path::{Path,PathBuf};
4
4
5
5
/// 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](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1).
Copy file name to clipboardexpand all lines: src/app_strategy/unix.rs
+7-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
use std::path::{Path,PathBuf};
2
2
3
+
usecrate::HomeDirError;
4
+
3
5
/// 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.
Copy file name to clipboardexpand all lines: src/app_strategy/windows.rs
+6-5
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
-
usecrate::base_strategy;
2
1
usecrate::base_strategy::BaseStrategy;
2
+
usecrate::{base_strategy,HomeDirError};
3
3
use std::path::{Path,PathBuf};
4
4
5
5
/// This strategy follows Windows’ conventions. It seems that all Windows GUI apps, and some command-line ones follow this pattern. The specification is available [here](https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid).
Copy file name to clipboardexpand all lines: src/app_strategy/xdg.rs
+6-5
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
-
usecrate::base_strategy;
2
1
usecrate::base_strategy::BaseStrategy;
2
+
usecrate::{base_strategy,HomeDirError};
3
3
use std::path::{Path,PathBuf};
4
4
5
5
/// This strategy implements the [XDG Base Directories Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). It is the most common on Linux, but is increasingly being adopted elsewhere.
/// Returns the current OS’s native [`BaseStrategy`](trait.BaseStrategy.html).
43
38
/// This uses the [`Windows`](struct.Windows.html) strategy on Windows, [`Apple`](struct.Apple.html) on macOS & iOS, and [`Xdg`](struct.Xdg.html) everywhere else.
44
39
/// This is the convention used by most GUI applications.
Copy file name to clipboardexpand all lines: src/base_strategy/apple.rs
+7-5
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
use std::path::{Path,PathBuf};
2
2
3
+
usecrate::HomeDirError;
4
+
3
5
/// 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](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1).
4
6
///
5
7
/// ```
@@ -40,16 +42,16 @@ use std::path::{Path, PathBuf};
Copy file name to clipboardexpand all lines: src/base_strategy/windows.rs
+9-8
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
use std::path::{Path,PathBuf};
2
2
3
+
usecrate::HomeDirError;
4
+
3
5
/// This strategy follows Windows’ conventions. It seems that all Windows GUI apps, and some command-line ones follow this pattern. The specification is available [here](https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid).
4
6
///
5
7
/// This initial example removes all the relevant environment variables to show the strategy’s use of the:
Copy file name to clipboardexpand all lines: src/base_strategy/xdg.rs
+9-8
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
use std::path::Path;
2
2
use std::path::PathBuf;
3
3
4
+
usecrate::HomeDirError;
5
+
4
6
/// This strategy implements the [XDG Base Directories Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). It is the most common on Linux, but is increasingly being adopted elsewhere.
5
7
///
6
8
/// This initial example removes all the XDG environment variables to show the strategy’s use of the XDG default directories.
0 commit comments