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.
Trait Implementations
impl AsRawHandle for Handle
[src]
fn as_raw_handle(&self) -> RawHandle
Extracts the raw handle, without taking any ownership.
impl IntoRawHandle for Handle
[src]
fn into_raw_handle(self) -> RawHandle
Consumes this object, returning the raw underlying handle. Read more