pub trait AsHandle {
    fn as_handle(&self) -> BorrowedHandle<'_>;
}
🔬 This is a nightly-only experimental API. (io_safety #87074)
Available on Windows only.
Expand description

A trait to borrow the handle from an underlying object.

Required Methods

🔬 This is a nightly-only experimental API. (io_safety #87074)

Borrows the handle.

Example
use std::fs::File;
use std::os::windows::io::{AsHandle, BorrowedHandle};

let mut f = File::open("foo.txt")?;
let borrowed_handle: BorrowedHandle<'_> = f.as_handle();
Run

Implementors