Expand description
I/O operations.
Modules
- epoll support.
Structs
O_*
constants for use withdup2
.errno
—An error code.EFD_*
flags for use witheventfd
.- A buffer type used with
Write::write_vectored
. - A buffer type used with
Read::read_vectored
. - A buffer type used with
vmsplice
. It is guaranteed to be ABI compatible with the iovec type on Unix platforms andWSABUF
on Windows. UnlikeIoSlice
andIoSliceMut
it is semantically like a raw pointer, and therefore can be shared or mutated as needed. O_*
constants for use withpipe_with
.struct pollfd
—File descriptor and flags for use withpoll
.POLL*
flags for use withpoll
.SPLICE_F_*
constants for use with [splice
] and [vmsplice
].
Enums
- Enumeration of possible methods to seek within an I/O object.
Constants
PIPE_BUF
—The maximum length at which writes to a pipe are atomic.
Functions
close(raw_fd)
—Closes aRawFd
directly.dup2(fd, new)
—Changes the file description of a file descriptor.- Utility function to safely
dup2
over stderr (fd 2). - Utility function to safely
dup2
over stdin (fd 0). - Utility function to safely
dup2
over stdout (fd 1). dup3(fd, new, flags)
—Changes the file description of a file descriptor, with flags.eventfd(initval, flags)
—Creates a file descriptor for event notification.fcntl(fd, F_DUPFD_CLOEXEC)
—Creates a newOwnedFd
instance, with value at leastmin
, that hasO_CLOEXEC
set and that shares the same underlying [file description] asfd
.fcntl(fd, F_GETFD)
—Returns a file descriptor’s flags.fcntl(fd, F_SETFD, flags)
—Sets a file descriptor’s flags.ioctl(fd, BLKPBSZGET)
—Returns the physical block size of a block device.ioctl(fd, BLKSSZGET)
—Returns the logical block size of a block device.ioctl(fd, FICLONE, src_fd)
—Share data between open files.ioctl(fd, FIONBIO, &value)
—Enables or disables non-blocking mode.ioctl(fd, FIONREAD)
—Returns the number of bytes ready to be read.ioctl(fd, TIOCEXCL)
—Enables exclusive mode on a terminal.ioctl(fd, TIOCNXCL)
—Disables exclusive mode on a terminal.pipe()
—Creates a pipe.pipe2(flags)
—Creates a pipe, with flags.poll(self.fds, timeout)
pread(fd, buf, offset)
—Reads from a file at a given position.preadv(fd, bufs, offset)
—Reads from a file at a given position into multiple buffers.preadv2(fd, bufs, offset, flags)
—Reads data, with several options.pwrite(fd, bufs)
—Writes to a file at a given position.pwritev(fd, bufs, offset)
—Writes to a file at a given position from multiple buffers.pwritev2(fd, bufs, offset, flags)
—Writes data, with several options.STDERR_FILENO
—Standard error, raw.STDIN_FILENO
—Standard input, raw.STDOUT_FILENO
—Standard output, raw.read(fd, buf)
—Reads from a stream.readv(fd, bufs)
—Reads from a stream into multiple buffers.- Call
f
until it either succeeds or fails other thanErrno::INTR
. splice(fd_in, off_in, fd_out, off_out, len, flags)
—Transfer data between a file and a pipe.STDERR_FILENO
—Standard error, borrowed.STDIN_FILENO
—Standard input, borrowed.STDOUT_FILENO
—Standard output, borrowed.STDERR_FILENO
—Standard error, owned.STDIN_FILENO
—Standard input, owned.STDOUT_FILENO
—Standard output, owned.vmsplice(fd, bufs, flags)
—Transfer data between memory and a pipe.write(fd, buf)
—Writes to a stream.writev(fd, bufs)
—Writes to a stream from multiple buffers.
Type Aliases
- A specialized
Result
type forrustix
APIs.