file_storage/path/system/
is_local.rs

1use crate::{FilePath, FolderPath, StoragePath};
2
3impl StoragePath {
4    //! Is System
5
6    /// Checks if the path is a local path.
7    pub fn is_local_path(&self) -> bool {
8        Self::is_local_path_str(self.path())
9    }
10
11    /// Checks if the `path` is a local path.
12    pub fn is_local_path_str<S>(path: S) -> bool
13    where
14        S: AsRef<str>,
15    {
16        let path: &str = path.as_ref();
17        StoragePath::is_unix_path_str(path) || StoragePath::is_windows_path_str(path)
18    }
19}
20
21impl FilePath {
22    //! Is System
23
24    /// Checks if the path is a local path.
25    pub fn is_local_path(&self) -> bool {
26        StoragePath::is_local_path_str(self.as_str())
27    }
28}
29
30impl FolderPath {
31    //! Is System
32
33    /// Checks if the path is a local path.
34    pub fn is_local_path(&self) -> bool {
35        StoragePath::is_local_path_str(self.as_str())
36    }
37}