pub struct Metadata { /* private fields */ }
Expand description
Metadata of a path.
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
the path of the file, like /path/to/file
Notes
Hadoop has restrictions of path name:
- A Path is comprised of Path elements separated by “/”.
- A path element is a unicode string of 1 or more characters.
- Path element MUST NOT include the characters “:” or “/”.
- Path element SHOULD NOT include characters of ASCII/UTF-8 value 0-31 .
- Path element MUST NOT be “.” or “..”
- Note also that the Azure blob store documents say that paths SHOULD NOT use a trailing “.” (as their .NET URI class strips it).
- Paths are compared based on unicode code-points.
- Case-insensitive and locale-specific comparisons MUST NOT not be used.
sourcepub fn len(&self) -> u64
pub fn len(&self) -> u64
the size of the file in bytes
Metadata is not a collection, so we will not provide is_empty
.
Keep the same style with std::fs::File
sourcepub fn permissions(&self) -> i16
pub fn permissions(&self) -> i16
the permissions associated with the file
sourcepub fn replication(&self) -> i16
pub fn replication(&self) -> i16
the count of replicas
sourcepub fn block_size(&self) -> i64
pub fn block_size(&self) -> i64
the block size for the file
sourcepub fn modified(&self) -> SystemTime
pub fn modified(&self) -> SystemTime
the last modification time for the file in seconds
sourcepub fn accessed(&self) -> SystemTime
pub fn accessed(&self) -> SystemTime
the last access time for the file in seconds
Trait Implementations§
source§impl From<hdfsFileInfo> for Metadata
impl From<hdfsFileInfo> for Metadata
source§fn from(hfi: hdfsFileInfo) -> Self
fn from(hfi: hdfsFileInfo) -> Self
Converts to this type from the input type.