[][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 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

impl Drop for OwnedHandle[src]

impl Debug for OwnedHandle[src]

impl IntoRawFd for OwnedHandle[src]

impl FromRawFd for OwnedHandle[src]

impl AsRawFd for OwnedHandle[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> AsRawSocketDescriptor for T where
    T: AsRawFd
[src]

impl<T> IntoRawSocketDescriptor for T where
    T: IntoRawFd
[src]

impl<T> FromRawSocketDescriptor for T where
    T: FromRawFd
[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]