Struct winapi_util::HandleRef[][src]

pub struct HandleRef(_);

Represents a borrowed and valid Windows handle to a file-like object, such as stdin/stdout/stderr or an actual file.

When a borrowed handle is dropped, then the underlying raw handle is not closed. To get an owned handle, use Handle.

Methods

impl HandleRef
[src]

Create a borrowed handle to stdin.

When the returned handle is dropped, stdin is not closed.

Create a handle to stdout.

When the returned handle is dropped, stdout is not closed.

Create a handle to stderr.

When the returned handle is dropped, stderr is not closed.

Create a borrowed handle to the given file.

When the returned handle is dropped, the file is not closed.

Create a borrowed handle from the given raw handle.

Note that unlike the FromRawHandle trait, this constructor does not consume ownership of the given handle. That is, when the borrowed handle created by this constructor is dropped, the underlying handle will not be closed.

Safety

This is unsafe because there is no guarantee that the given raw handle is a valid handle. The caller must ensure this is true before invoking this constructor.

Return this handle as a standard File reference.

Return this handle as a standard File mutable reference.

Trait Implementations

impl Debug for HandleRef
[src]

Formats the value using the given formatter. Read more

impl AsRawHandle for HandleRef
[src]

Extracts the raw handle, without taking any ownership.

impl Clone for HandleRef
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl AsHandleRef for HandleRef
[src]

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

Auto Trait Implementations

impl Send for HandleRef

impl Sync for HandleRef