pub trait IntoFd { fn into_fd(self) -> OwnedFd; }
A trait to express the ability to consume an object and acquire ownership of its file descriptor.
Consumes this object, returning the underlying file descriptor.
use std::fs::File; use io_lifetimes::{IntoFd, OwnedFd}; let f = File::open("foo.txt")?; let owned_fd: OwnedFd = f.into_fd();