pub trait AsFdExt: AsFd {
// Provided methods
fn borrow_file(&self) -> BorrowedFd<'_> { ... }
fn duplicate_file(&self) -> Result<OwnedFd> { ... }
}Provided Methods§
Sourcefn borrow_file(&self) -> BorrowedFd<'_>
fn borrow_file(&self) -> BorrowedFd<'_>
Borrow the current file descriptor as a BorrowFd.
This method provides a cross-platform way of calling
as_fd() on Unix and as_handle() on Windows.
Sourcefn duplicate_file(&self) -> Result<OwnedFd>
fn duplicate_file(&self) -> Result<OwnedFd>
Duplicates the current file descriptor as an OwnedFd.
This is a shorthand for to file.borrow_fd().try_clone_to_owned().