Trait std::os::unix::fs::MetadataExt 1.1.0[−][src]
pub trait MetadataExt {
Show methods
fn dev(&self) -> u64;
fn ino(&self) -> u64;
fn mode(&self) -> u32;
fn nlink(&self) -> u64;
fn uid(&self) -> u32;
fn gid(&self) -> u32;
fn rdev(&self) -> u64;
fn size(&self) -> u64;
fn atime(&self) -> i64;
fn atime_nsec(&self) -> i64;
fn mtime(&self) -> i64;
fn mtime_nsec(&self) -> i64;
fn ctime(&self) -> i64;
fn ctime_nsec(&self) -> i64;
fn blksize(&self) -> u64;
fn blocks(&self) -> u64;
}This is supported on Unix only.
Expand description
Unix-specific extensions to fs::Metadata.
Required methods
fn dev(&self) -> u64[src]
Expand description
fn ino(&self) -> u64[src]
Expand description
fn mode(&self) -> u32[src]
Expand description
Returns the rights applied to this file.
Examples
use std::fs; use std::os::unix::fs::MetadataExt; use std::io; fn main() -> io::Result<()> { let meta = fs::metadata("some_file")?; let mode = meta.mode(); let user_has_write_access = mode & 0o200; let user_has_read_write_access = mode & 0o600; let group_has_read_access = mode & 0o040; let others_have_exec_access = mode & 0o001; Ok(()) }Run
fn nlink(&self) -> u64[src]
Expand description
fn uid(&self) -> u32[src]
Expand description
fn gid(&self) -> u32[src]
Expand description
fn rdev(&self) -> u64[src]
Expand description
fn size(&self) -> u64[src]
Expand description
fn atime(&self) -> i64[src]
Expand description
fn atime_nsec(&self) -> i64[src]
Expand description
fn mtime(&self) -> i64[src]
Expand description
fn mtime_nsec(&self) -> i64[src]
Expand description
fn ctime(&self) -> i64[src]
Expand description
fn ctime_nsec(&self) -> i64[src]
Expand description
fn blksize(&self) -> u64[src]
Expand description
fn blocks(&self) -> u64[src]
Expand description
Returns the number of blocks allocated to the file, in 512-byte units.
Please note that this may be smaller than st_size / 512 when the file has holes.
Examples
use std::fs; use std::os::unix::fs::MetadataExt; use std::io; fn main() -> io::Result<()> { let meta = fs::metadata("some_file")?; let blocks = meta.blocks(); Ok(()) }Run
Implementors
impl MetadataExt for Metadata[src]
impl MetadataExt for Metadata[src]