Struct same_file::Handle
[−]
[src]
pub struct Handle(_);
A handle to a file that can be tested for equality with other handles.
If two files are the same, then any two handles of those files will compare equal. If two files are not the same, then any two handles of those files will compare not-equal.
A handle consumes an open file resource as long as it exists.
Note that it's possible for comparing two handles to produce a false positive on some platforms. Namely, two handles can compare equal even if the two handles don't point to the same file.
Methods
impl Handle
[src]
fn from_path<P: AsRef<Path>>(p: P) -> Result<Handle>
Construct a handle from a path.
Note that the underlying File
is opened in read-only mode on all
platforms.
fn from_file(file: File) -> Result<Handle>
Construct a handle from a file.
fn stdin() -> Result<Handle>
Construct a handle from stdin.
fn stdout() -> Result<Handle>
Construct a handle from stdout.
fn stderr() -> Result<Handle>
Construct a handle from stderr.
fn as_file(&self) -> &File
Return a reference to the underlying file.
fn as_file_mut(&mut self) -> &mut File
Return a mutable reference to the underlying file.
fn dev(&self) -> u64
Return the underlying device number of this handle.
fn ino(&self) -> u64
Return the underlying inode number of this handle.
Trait Implementations
impl AsRawFd for Handle
[src]
impl IntoRawFd for Handle
[src]
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more