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&lt;...&gt; for OwnedFd</code> or <code>Into&lt;OwnedFd&gt;</code>
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: <code>IntoFd</code> is replaced by <code>From&lt;...&gt; for OwnedFd</code> or <code>Into&lt;OwnedFd&gt;</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();

Implementors§

source§

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