@@ -6,53 +6,53 @@ use core::fmt::Debug;
6
6
/// File system trait
7
7
pub trait FileSystem : Debug + Sync + Send {
8
8
/// Iterates over all direct children of this directory path
9
- fn read_dir ( & self , path : & str ) -> Result < Box < dyn Iterator < Item = Metadata > + Send > > ;
9
+ fn read_dir ( & self , path : & str ) -> FsResult < Box < dyn Iterator < Item = Metadata > + Send > > ;
10
10
11
11
/// Opens the file at this path for reading
12
- fn open_file ( & self , path : & str ) -> Result < FileHandle > ;
12
+ fn open_file ( & self , path : & str ) -> FsResult < FileHandle > ;
13
13
14
14
/// Returns the file metadata for the file at this path
15
- fn metadata ( & self , path : & str ) -> Result < Metadata > ;
15
+ fn metadata ( & self , path : & str ) -> FsResult < Metadata > ;
16
16
17
17
/// Returns true if a file or directory at path exists, false otherwise
18
- fn exists ( & self , path : & str ) -> Result < bool > ;
18
+ fn exists ( & self , path : & str ) -> FsResult < bool > ;
19
19
20
20
// ----------------------------------------------------
21
21
// NOTE: following functions are not implemented (optional)
22
22
// ----------------------------------------------------
23
23
24
24
/// Creates a file at this path for writing
25
- fn create_file ( & self , _path : & str ) -> Result < FileHandle > {
25
+ fn create_file ( & self , _path : & str ) -> FsResult < FileHandle > {
26
26
Err ( FsError :: NotSupported )
27
27
}
28
28
29
29
/// Opens the file at this path for appending
30
- fn append_file ( & self , _path : & str ) -> Result < FileHandle > {
30
+ fn append_file ( & self , _path : & str ) -> FsResult < FileHandle > {
31
31
Err ( FsError :: NotSupported )
32
32
}
33
33
34
34
/// Removes the file at this path
35
- fn remove_file ( & self , _path : & str ) -> Result < FileHandle > {
35
+ fn remove_file ( & self , _path : & str ) -> FsResult < FileHandle > {
36
36
Err ( FsError :: NotSupported )
37
37
}
38
38
39
39
/// Removes the directory at this path
40
- fn remove_dir ( & self , _path : & str ) -> Result < FileHandle > {
40
+ fn remove_dir ( & self , _path : & str ) -> FsResult < FileHandle > {
41
41
Err ( FsError :: NotSupported )
42
42
}
43
43
44
44
/// Copies the src path to the destination path within the same filesystem
45
- fn copy_file ( & self , _src : & str , _dst : & str ) -> Result < ( ) > {
45
+ fn copy_file ( & self , _src : & str , _dst : & str ) -> FsResult {
46
46
Err ( FsError :: NotSupported )
47
47
}
48
48
49
49
/// Moves the src path to the destination path within the same filesystem
50
- fn move_file ( & self , _src : & str , _dst : & str ) -> Result < ( ) > {
50
+ fn move_file ( & self , _src : & str , _dst : & str ) -> FsResult {
51
51
Err ( FsError :: NotSupported )
52
52
}
53
53
54
54
/// Moves the src directory to the destination path within the same filesystem
55
- fn move_dir ( & self , _src : & str , _dst : & str ) -> Result < ( ) > {
55
+ fn move_dir ( & self , _src : & str , _dst : & str ) -> FsResult {
56
56
Err ( FsError :: NotSupported )
57
57
}
58
58
}
0 commit comments