Trait io_lifetimes::IntoSocketlike[][src]

pub trait IntoSocketlike: IntoSocket {
    fn into_socketlike(self) -> OwnedSocketlike;
}
Expand description

A portable trait to express the ability to consume an object and acquire ownership of its socketlike object.

This is a portability abstraction over Unix-like IntoFd and Windows’ IntoSocket.

Required methods

Consumes this object, returning the underlying socketlike object.

Example

use std::fs::File;
use io_lifetimes::{IntoFilelike, OwnedFilelike};

let f = File::open("foo.txt")?;
let owned_filelike: OwnedFilelike = f.into_filelike();

Implementors