Trait io_lifetimes::IntoFd
source · pub trait IntoFd {
// Required method
fn into_fd(self) -> OwnedFd;
}
👎Deprecated since 1.0.0: <code>IntoFd</code> is replaced by <code>From<...> for OwnedFd</code> or <code>Into<OwnedFd></code>
Expand description
A trait to express the ability to consume an object and acquire ownership of its file descriptor.
Required Methods§
sourcefn into_fd(self) -> OwnedFd
fn into_fd(self) -> OwnedFd
👎Deprecated since 1.0.0: <code>IntoFd</code> is replaced by <code>From<...> for OwnedFd</code> or <code>Into<OwnedFd></code>
Consumes this object, returning the underlying file descriptor.
Example
use std::fs::File;
use io_lifetimes::{IntoFd, OwnedFd};
let f = File::open("foo.txt")?;
let owned_fd: OwnedFd = f.into_fd();