Struct filedescriptor::OwnedHandle
source · [−]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
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