[][src]Trait std::os::fortanix_sgx::io::TryIntoRawFd

pub trait TryIntoRawFd: Sized {
    fn try_into_raw_fd(self) -> Result<RawFd, Self>;
}
🔬 This is a nightly-only experimental API. (sgx_platform #56975)

A trait to express the ability to consume an object and acquire ownership of its raw file descriptor.

Required methods

fn try_into_raw_fd(self) -> Result<RawFd, Self>

🔬 This is a nightly-only experimental API. (sgx_platform #56975)

Consumes this object, returning the raw underlying file descriptor, if this object is not cloned.

This function transfers ownership of the underlying file descriptor to the caller. Callers are then the unique owners of the file descriptor and must close the descriptor once it's no longer needed.

Unlike other platforms, on SGX, the file descriptor is shared between all clones of an object. To avoid race conditions, this function will only return Ok when called on the final clone.

Loading content...

Implementors

impl TryIntoRawFd for TcpListener[src]

impl TryIntoRawFd for TcpStream[src]

Loading content...