Skip to main content

minio_rsc/client/
response.rs

1use std::collections::HashMap;
2
3/// Info of the object.
4#[derive(Debug, Clone)]
5pub struct ObjectStat {
6    pub(crate) bucket_name: String,
7    pub(crate) object_name: String,
8    pub(crate) last_modified: String,
9    pub(crate) etag: String,
10    pub(crate) content_type: String,
11    pub(crate) version_id: String,
12    pub(crate) size: usize,
13    pub(crate) metadata: HashMap<String, String>,
14}
15
16impl ObjectStat {
17    /// Bucket name of the object.
18    pub fn bucket_name(&self) -> &str {
19        self.bucket_name.as_str()
20    }
21
22    /// Name of the object.
23    pub fn object_name(&self) -> &str {
24        self.object_name.as_str()
25    }
26
27    /// Last modified time of the object.
28    pub fn last_modified(&self) -> &str {
29        self.last_modified.as_str()
30    }
31
32    /// Etag of the object.
33    pub fn etag(&self) -> &str {
34        self.etag.as_str()
35    }
36
37    /// Content type of the object
38    pub fn content_type(&self) -> &str {
39        self.content_type.as_str()
40    }
41
42    /// Version of the object.
43    pub fn version_id(&self) -> &str {
44        self.version_id.as_str()
45    }
46
47    /// Size of the object.
48    pub fn size(&self) -> usize {
49        self.size
50    }
51
52    /// Metadata of the object.
53    pub fn metadata(&self) -> &HashMap<String, String> {
54        &self.metadata
55    }
56}