shell::platform

Trait FromFileDesc

Source
pub trait FromFileDesc {
    // Required method
    unsafe fn from_file_desc(fd: FileDesc) -> Self;
}
Expand description

Trait to turn a UnixFileDesc into another object (like File).

Required Methods§

Source

unsafe fn from_file_desc(fd: FileDesc) -> Self

Constructs a new instance of Self from the given UnixFileDesc.

§Safety

The fd passed in must be a valid and open file descriptor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromFileDesc for File

Source§

unsafe fn from_file_desc(fd: UnixFileDesc) -> Self

Implementors§