Struct std::fs::FileType1.1.0 [] [src]

pub struct FileType(_);

A structure representing a type of file with accessors for each file type. It is returned by Metadata::file_type method.

Methods

impl FileType
[src]

Test whether this file type represents a directory.

Examples

use std::fs;

let metadata = try!(fs::metadata("foo.txt"));
let file_type = metadata.file_type();

assert_eq!(file_type.is_dir(), false);Run

Test whether this file type represents a regular file.

Examples

use std::fs;

let metadata = try!(fs::metadata("foo.txt"));
let file_type = metadata.file_type();

assert_eq!(file_type.is_file(), true);Run

Test whether this file type represents a symbolic link.

Examples

use std::fs;

let metadata = try!(fs::metadata("foo.txt"));
let file_type = metadata.file_type();

assert_eq!(file_type.is_symlink(), false);Run

Trait Implementations

impl Copy for FileType
[src]

impl Clone for FileType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for FileType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for FileType
[src]

impl Hash for FileType
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl Debug for FileType
[src]

Formats the value using the given formatter.

impl FileTypeExt for FileType
1.5.0
[src]

Returns whether this file type is a block device.

Returns whether this file type is a char device.

Returns whether this file type is a fifo.

Returns whether this file type is a socket.