file_storage/path/system/
is_unix.rs

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