Trait unsafe_io::FromUnsafeHandle[][src]

pub trait FromUnsafeHandle {
    unsafe fn from_unsafe_handle(unsafe_handle: UnsafeHandle) -> Self;
}

A trait for types which can be constructed from an unsafe handle.

Note: Don't implement this trait for types which require an UnsafeFile-like handle or an UnsafeSocket-like handle, such that it would need to panic if passed the wrong form.

Required methods

unsafe fn from_unsafe_handle(unsafe_handle: UnsafeHandle) -> Self[src]

Constructs a new instance of Self from the given unsafe handle.

Safety

This function consumes ownership of the specified file descriptor. The returned object will take responsibility for closing it when the object goes out of scope.

Loading content...

Implementors

impl FromUnsafeHandle for UnsafeHandle[src]

UnsafeHandle doesn't own its handle; see the comments for impl AsRawFd for UnsafeHandle.

impl FromUnsafeHandle for UnsafeReadable[src]

UnsafeReadable doesn't own its handle; see the comments for impl AsRawFd for UnsafeHandle.

impl FromUnsafeHandle for UnsafeWriteable[src]

UnsafeWriteable doesn't own its handle; see the comments for impl AsRawFd for UnsafeHandle.

Loading content...