Skip to content

Commit

Permalink
Add dev and ino to MetadataExt
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Jan 31, 2017
1 parent fc57e40 commit b13d9ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libstd/sys/redox/ext/fs.rs
Expand Up @@ -160,6 +160,10 @@ impl OpenOptionsExt for OpenOptions {
// casts and rely on manual lowering to `stat` if the raw type is desired.
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
#[stable(feature = "metadata_ext", since = "1.1.0")]
fn dev(&self) -> u64;
#[stable(feature = "metadata_ext", since = "1.1.0")]
fn ino(&self) -> u64;
#[stable(feature = "metadata_ext", since = "1.1.0")]
fn mode(&self) -> u32;
#[stable(feature = "metadata_ext", since = "1.1.0")]
Expand All @@ -184,6 +188,12 @@ pub trait MetadataExt {

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for fs::Metadata {
fn dev(&self) -> u64 {
self.as_inner().as_inner().st_dev as u64
}
fn ino(&self) -> u64 {
self.as_inner().as_inner().st_ino as u64
}
fn mode(&self) -> u32 {
self.as_inner().as_inner().st_mode as u32
}
Expand Down

0 comments on commit b13d9ce

Please sign in to comment.