Trait io_lifetimes::IntoFd

source ·
pub trait IntoFd {
    // Required method
    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§

source

fn into_fd(self) -> OwnedFd

👎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§

source§

impl<T> IntoFd for T
where OwnedFd: From<T>,