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]
pub fn from_path<P: AsRef<Path>>(p: P) -> Result<Handle>
[src]
Construct a handle from a path.
Note that the underlying File
is opened in read-only mode on all
platforms.
pub fn from_file(file: File) -> Result<Handle>
[src]
Construct a handle from a file.
pub fn stdin() -> Result<Handle>
[src]
Construct a handle from stdin.
pub fn stdout() -> Result<Handle>
[src]
Construct a handle from stdout.
pub fn stderr() -> Result<Handle>
[src]
Construct a handle from stderr.
pub fn as_file(&self) -> &File
[src]
Return a reference to the underlying file.
pub fn as_file_mut(&mut self) -> &mut File
[src]
Return a mutable reference to the underlying file.
pub fn dev(&self) -> u64
[src]
Return the underlying device number of this handle.
pub fn ino(&self) -> u64
[src]
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
[src]
Consumes this object, returning the raw underlying file descriptor. Read more