Class: OpenDAL::Entry
- Inherits:
-
Object
- Object
- OpenDAL::Entry
- Defined in:
- src/lister.rs,
lib/opendal_ruby/entry.rb
Overview
Entry returned by Lister to represent a path and it's relative metadata.
Instance Method Summary collapse
-
#metadata ⇒ Metadata
Fetches the metadata of this entry.
-
#name ⇒ String
Gets the name of entry.
-
#path ⇒ String
Gets the path of entry.
-
#to_h ⇒ Object
Returns the canonical data about an entry.
Instance Method Details
#metadata ⇒ Metadata
Fetches the metadata of this entry.
74 75 76 77 |
# File 'src/lister.rs', line 74
fn metadata(&self) -> Result<Metadata, Error> {
Ok(Metadata::new(self.0.metadata().clone()))
}
}
|
#name ⇒ String
Gets the name of entry. Name is the last segment of path.
If this entry is a dir, name
MUST end with /
Otherwise, name
MUST NOT end with /
.
66 67 68 |
# File 'src/lister.rs', line 66
fn name(&self) -> Result<&str, Error> {
Ok(self.0.name())
}
|
#path ⇒ String
Gets the path of entry. Path is relative to operator's root.
Only valid in current operator.
If this entry is a dir, path
MUST end with /
Otherwise, path
MUST NOT end with /
.
55 56 57 |
# File 'src/lister.rs', line 55
fn path(&self) -> Result<&str, Error> {
Ok(self.0.path())
}
|
#to_h ⇒ Object
Returns the canonical data about an entry
23 24 25 26 27 28 |
# File 'lib/opendal_ruby/entry.rb', line 23 def to_h { path: path, metadata: } end |