[−][src]Struct filedescriptor::OwnedHandle
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) -> Result<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) -> Result<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 AsRawFd for OwnedHandle
[src]
impl Debug for OwnedHandle
[src]
impl Drop for OwnedHandle
[src]
impl FromRawFd for OwnedHandle
[src]
unsafe fn from_raw_fd(fd: RawFd) -> Self
[src]
impl IntoRawFd for OwnedHandle
[src]
fn into_raw_fd(self) -> RawFd
[src]
Auto Trait Implementations
impl RefUnwindSafe for OwnedHandle
impl Send for OwnedHandle
impl Sync for OwnedHandle
impl Unpin for OwnedHandle
impl UnwindSafe for OwnedHandle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsRawFileDescriptor for T where
T: AsRawFd,
[src]
T: AsRawFd,
fn as_raw_file_descriptor(&Self) -> i32
[src]
impl<T> AsRawSocketDescriptor for T where
T: AsRawFd,
[src]
T: AsRawFd,
fn as_socket_descriptor(&Self) -> i32
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FromRawFileDescriptor for T where
T: FromRawFd,
[src]
T: FromRawFd,
unsafe fn from_raw_file_descriptor(i32) -> T
[src]
impl<T> FromRawSocketDescriptor for T where
T: FromRawFd,
[src]
T: FromRawFd,
unsafe fn from_socket_descriptor(i32) -> T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRawFileDescriptor for T where
T: IntoRawFd,
[src]
T: IntoRawFd,
fn into_raw_file_descriptor(Self) -> i32
[src]
impl<T> IntoRawSocketDescriptor for T where
T: IntoRawFd,
[src]
T: IntoRawFd,
fn into_socket_descriptor(Self) -> i32
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,