Sha256: a7d3cc1b8673a94d64926c03984e24a627c24e78f09070a2eb893d8005abf9d7

Contents?: true

Size: 679 Bytes

Versions: 4

Compression:

Stored size: 679 Bytes

Contents

//! The [`is_read_write`] function.
//!
//! [`is_read_write`]: https://docs.rs/rustix/*/rustix/io/fn.is_read_write.html

use crate::{backend, io};
use backend::fd::AsFd;

/// Returns a pair of booleans indicating whether the file descriptor is
/// readable and/or writable, respectively.
///
/// Unlike [`is_file_read_write`], this correctly detects whether sockets
/// have been shutdown, partially or completely.
///
/// [`is_file_read_write`]: crate::fs::is_file_read_write
#[inline]
#[cfg_attr(docsrs, doc(cfg(all(feature = "fs", feature = "net"))))]
pub fn is_read_write<Fd: AsFd>(fd: Fd) -> io::Result<(bool, bool)> {
    backend::io::syscalls::is_read_write(fd.as_fd())
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/rustix-0.38.44/src/io/is_read_write.rs
wasmtime-28.0.0 ./ext/cargo-vendor/rustix-0.38.43/src/io/is_read_write.rs
wasmtime-27.0.0 ./ext/cargo-vendor/rustix-0.38.41/src/io/is_read_write.rs
wasmtime-26.0.0 ./ext/cargo-vendor/rustix-0.38.37/src/io/is_read_write.rs