pub trait IntoFilelike: Into<OwnedFd> {
// Required method
fn into_filelike(self) -> OwnedFilelike;
}
Expand description
A portable trait to express the ability to consume an object and acquire ownership of its filelike object.
This is a portability abstraction over Unix-like Into<OwnedFd>
and
Windows’ Into<OwnedHandle>
.
Required Methods§
Sourcefn into_filelike(self) -> OwnedFilelike
fn into_filelike(self) -> OwnedFilelike
Consumes this object, returning the underlying filelike object.
§Example
use std::fs::File;
use io_lifetimes::{IntoFilelike, OwnedFilelike};
let f = File::open("foo.txt")?;
let owned_filelike: OwnedFilelike = f.into_filelike();
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.