docs

std::os::unix::io

本页内容

API 参考只有英文版,由标准库源代码中的英文文档注释生成。

raw file descriptors. File, the sockets, the child pipes and the standard streams implement AsRawFd; FromRawFd takes ownership of a descriptor and IntoRawFd gives it up.

Traits

AsRawFdSource

pub trait AsRawFd

The descriptor behind a handle, still owned by it (-1 once the handle is closed).

  • fn as_raw_fd(self) -> RawFd§

    Source

    The file descriptor, still owned by self.

FromRawFdSource

pub trait FromRawFd

A handle that owns descriptor fd from now on: closing the handle closes fd.

  • unsafe fn from_raw_fd(fd: RawFd) -> Self§

    Source

    Safety: fd must be open, and nothing else may close it.

IntoRawFdSource

pub trait IntoRawFd

A handle that gives up its descriptor: the handle is consumed and nothing closes the fd; the caller owns it.

  • fn into_raw_fd(self) -> RawFd§

    Source

    The file descriptor, now the caller's to close (-1 if self was closed).

Type aliases

RawFdSource

pub type RawFd = i32

A file descriptor.