pub trait IntoFd {
    fn into_fd(self) -> OwnedFd;
}
👎 Deprecated since 1.0.0:

IntoFd is replaced by From<...> for OwnedFd or Into<OwnedFd>

Expand description

A trait to express the ability to consume an object and acquire ownership of its file descriptor.

Required Methods

👎 Deprecated since 1.0.0:

IntoFd is replaced by From<...> for OwnedFd or Into<OwnedFd>

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();

Implementors