Class: OpenDAL::Entry

Inherits:
Object
  • Object
show all
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

Instance Method Details

#metadataMetadata

Fetches the metadata of this entry.

Returns:



74
75
76
77
# File 'src/lister.rs', line 74

fn metadata(&self) -> Result<Metadata, Error> {
        Ok(Metadata::new(self.0.metadata().clone()))
    }
}

#nameString

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 /.

Returns:

  • (String)


66
67
68
# File 'src/lister.rs', line 66

fn name(&self) -> Result<&str, Error> {
    Ok(self.0.name())
}

#pathString

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 /.

Returns:

  • (String)


55
56
57
# File 'src/lister.rs', line 55

fn path(&self) -> Result<&str, Error> {
    Ok(self.0.path())
}

#to_hObject

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