A handle represents an owned and valid Windows handle to a file-like
object.
When an owned handle is dropped, then the underlying raw handle is closed.
To get a borrowed handle, use HandleRef
.
Create an owned handle to the given file.
When the returned handle is dropped, the file is closed.
Note that if the given file represents a handle to a directory, then
it is generally required that it have been opened with the
FILE_FLAG_BACKUP_SEMANTICS
flag in order to use it in various
calls such as information
or typ
. To have this done automatically
for you, use the from_path_any
constructor.
Open a file to the given file path, and return an owned handle to that
file.
When the returned handle is dropped, the file is closed.
If there was a problem opening the file, then the corresponding error
is returned.
Like from_path
, but supports opening directory handles as well.
If you use from_path
on a directory, then subsequent queries using
that handle will fail.
Return this handle as a standard File
reference.
Return this handle as a standard File
mutable reference.
A borrowed handle that wraps the raw handle of the Self
object.
A convenience routine for extracting a HandleRef
from Self
, and then extracting a raw handle from the HandleRef
. Read more
Formats the value using the given formatter. Read more
Extracts the raw handle, without taking any ownership.
Constructs a new I/O object from the specified raw handle. Read more
Consumes this object, returning the raw underlying handle. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)