Trait async_std::os::unix::io::AsRawFd1.0.0[][src]

pub trait AsRawFd {
    pub fn as_raw_fd(&self) -> i32;
}

A trait to extract the raw unix file descriptor from an underlying object.

This is only available on unix platforms and must be imported in order to call the method. Windows platforms have a corresponding AsRawHandle and AsRawSocket set of traits.

Required methods

pub fn as_raw_fd(&self) -> i32[src]

Extracts the raw file descriptor.

This method does not pass ownership of the raw file descriptor to the caller. The descriptor is only guaranteed to be valid while the original object has not yet been destroyed.

Example

use std::fs::File;
use std::os::unix::io::{AsRawFd, RawFd};

let mut f = File::open("foo.txt")?;
// Note that `raw_fd` is only valid as long as `f` exists.
let raw_fd: RawFd = f.as_raw_fd();
Loading content...

Implementations on Foreign Types

impl AsRawFd for Stdin[src]

impl AsRawFd for i32[src]

impl AsRawFd for ChildStderr[src]

impl<'a> AsRawFd for StderrLock<'a>[src]

impl AsRawFd for Stderr[src]

impl AsRawFd for TcpListener[src]

impl AsRawFd for ChildStdout[src]

impl<'a> AsRawFd for StdoutLock<'a>[src]

impl AsRawFd for TcpStream[src]

impl AsRawFd for ChildStdin[src]

impl AsRawFd for UdpSocket[src]

impl AsRawFd for File[src]

impl<'a> AsRawFd for StdinLock<'a>[src]

impl AsRawFd for Stdout[src]

impl AsRawFd for UnixDatagram[src]

impl AsRawFd for UnixStream[src]

impl AsRawFd for UnixListener[src]

impl<T> AsRawFd for Async<T> where
    T: AsRawFd
[src]

impl AsRawFd for Socket[src]

Loading content...

Implementors

impl AsRawFd for async_std::fs::File[src]

impl AsRawFd for async_std::io::Stderr[src]

impl AsRawFd for async_std::io::Stdin[src]

impl AsRawFd for async_std::io::Stdout[src]

impl AsRawFd for async_std::net::TcpListener[src]

impl AsRawFd for async_std::net::TcpStream[src]

impl AsRawFd for async_std::net::UdpSocket[src]

impl AsRawFd for async_std::os::unix::net::UnixDatagram[src]

impl AsRawFd for async_std::os::unix::net::UnixListener[src]

impl AsRawFd for async_std::os::unix::net::UnixStream[src]

Loading content...