pub struct OwnedHandle { /* private fields */ }
Expand description

OwnedHandle allows managing the lifetime of the platform RawFileDescriptor type. It is exposed in the interface of this crate primarily for convenience on Windows where the system handle type is used for a variety of objects that don’t support reading and writing.

Implementations

Create a new handle from some object that is convertible into the system RawFileDescriptor type. This consumes the parameter and replaces it with an OwnedHandle instance.

Attempt to duplicate the underlying handle and return an OwnedHandle wrapped around the duplicate. Since the duplication requires kernel resources that may not be available, this is a potentially fallible operation. The returned handle has a separate lifetime from the source, but references the same object at the kernel level.

Attempt to duplicate the underlying handle from an object that is representable as the system RawFileDescriptor type and return an OwnedHandle wrapped around the duplicate. Since the duplication requires kernel resources that may not be available, this is a potentially fallible operation. The returned handle has a separate lifetime from the source, but references the same object at the kernel level.

Trait Implementations

Extracts the raw file descriptor. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Constructs a new instance of Self from the given raw file descriptor. Read more

Consumes this object, returning the raw underlying file descriptor. Read more

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.