Struct io_lifetimes::OwnedHandle[][src]

#[repr(transparent)]
pub struct OwnedHandle { /* fields omitted */ }
Expand description

An owned handle.

This closes the handle on drop.

This uses repr(transparent) and has the representation of a host handle, so it can be used in FFI in places where a handle is passed as a consumed argument or returned as an owned value, and is never null.

Note that it may have the value [INVALID_HANDLE_VALUE]. See here for the full story. For APIs like CreateFileW which report errors with INVALID_HANDLE_VALUE instead of null, use OptionFileHandle instead of Option<OwnedHandle>.

Trait Implementations

Borrows the handle. Read more

Extracts the raw handle, without taking any ownership.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Performs the conversion.

Constructs a new instance of Self from the given handle. Read more

Constructs a new instance of Self from the given handle converted from into_owned. Read more

Constructs a new instance of Self from the given raw handle.

Safety

The resource pointed to by raw must be open and suitable for assuming ownership.

Consumes this object, returning the underlying handle. Read more

Consumes this object, returning the raw underlying handle. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.