AsFdExt

Trait AsFdExt 

Source
pub trait AsFdExt: AsFd {
    // Provided methods
    fn borrow_file(&self) -> BorrowedFd<'_> { ... }
    fn duplicate_file(&self) -> Result<OwnedFd> { ... }
}

Provided Methods§

Source

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.

Source

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().

Implementors§

Source§

impl<T: AsFd> AsFdExt for T