[][src]Struct filedescriptor::OwnedHandle

pub struct OwnedHandle { /* fields omitted */ }

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.

Methods

impl OwnedHandle[src]

pub fn new<F: IntoRawFileDescriptor>(f: F) -> Self[src]

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.

pub fn try_clone(&self) -> Fallible<Self>[src]

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.

pub fn dup<F: AsRawFileDescriptor>(f: &F) -> Fallible<Self>[src]

Attempt to duplicate the underlying handle from an object that is representable as the systemm 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

impl Drop for OwnedHandle[src]

impl Send for OwnedHandle[src]

impl Debug for OwnedHandle[src]

impl IntoRawHandle for OwnedHandle[src]

impl AsRawHandle for OwnedHandle[src]

impl FromRawHandle for OwnedHandle[src]

Auto Trait Implementations

impl !Sync for OwnedHandle

Blanket Implementations

impl<T> AsRawFileDescriptor for T where
    T: AsRawHandle
[src]

impl<T> IntoRawFileDescriptor for T where
    T: IntoRawHandle
[src]

impl<T> FromRawFileDescriptor for T where
    T: FromRawHandle
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]