1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use libunftp::storage::Error;
use libunftp::storage::Metadata;
use std::time::SystemTime;
#[derive(Clone, Debug)]
pub struct ObjectMetadata {
pub(crate) last_updated: SystemTime,
pub(crate) is_file: bool,
pub(crate) size: u64,
}
impl Metadata for ObjectMetadata {
fn len(&self) -> u64 {
self.size
}
fn is_dir(&self) -> bool {
!self.is_file()
}
fn is_file(&self) -> bool {
self.is_file
}
fn is_symlink(&self) -> bool {
false
}
fn modified(&self) -> Result<SystemTime, Error> {
Ok(self.last_updated)
}
fn gid(&self) -> u32 {
0
}
fn uid(&self) -> u32 {
0
}
}