• Home
  • Raw
  • Download

Lines Matching +full:cap +full:- +full:std

1 //! `rustix` provides efficient memory-safe and [I/O-safe] wrappers to
2 //! POSIX-like, Unix-like, Linux, and Winsock2 syscall-like APIs, with
9 //! # fn read(sock: std::net::TcpStream, buf: &mut [u8]) -> std::io::Result<()> {
21 //! # fn read(sock: std::net::TcpStream, buf: &mut [u8]) -> std::io::Result<()> {
22 //! # use std::convert::TryInto;
24 //! # use std::os::unix::io::AsRawFd;
26 //! # use std::os::wasi::io::AsRawFd;
30 //! # use std::os::windows::io::AsRawSocket;
43 //! -1 => return Err(std::io::Error::last_os_error()),
53 //! - Error values are translated to [`Result`]s.
54 //! - Buffers are passed as Rust slices.
55 //! - Out-parameters are presented as return values.
56 //! - Path arguments use [`Arg`], so they accept any string type.
57 //! - File descriptors are passed and returned via [`AsFd`] and [`OwnedFd`]
59 //! - Constants use `enum`s and [`bitflags`] types.
60 //! - Multiplexed functions (eg. `fcntl`, `ioctl`, etc.) are de-multiplexed.
61 //! - Variadic functions (eg. `openat`, etc.) are presented as non-variadic.
62 //! - Functions and types which need `l` prefixes or `64` suffixes to enable
63 //! large-file support are used automatically, and file sizes and offsets
65 //! - Behaviors that depend on the sizes of C types like `long` are hidden.
66 //! - In some places, more human-friendly and less historical-accident names
69 //! - Provide y2038 compatibility, on platforms which support this.
70 //! - Correct selected platform bugs, such as behavioral differences when
74 //! - Detecting whether functions are supported at runtime.
75 //! - Hiding significant differences between platforms.
76 //! - Restricting ambient authorities.
77 //! - Imposing sandboxing features such as filesystem path or network address
80 //! See [`cap-std`], [`system-interface`], and [`io-streams`] for libraries
81 //! which do hide significant differences between platforms, and [`cap-std`]
84 //! [`cap-std`]: https://crates.io/crates/cap-std
85 //! [`system-interface`]: https://crates.io/crates/system-interface
86 //! [`io-streams`]: https://crates.io/crates/io-streams
89 //! [`AsFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/trait.AsFd.html
90 //! [`OwnedFd`]: https://docs.rs/io-lifetimes/latest/io_lifetimes/struct.OwnedFd.html
91 //! [io-lifetimes crate]: https://crates.io/crates/io-lifetimes
92 //! [I/O-safe]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
101 #![cfg_attr(all(target_os = "wasi", feature = "std"), feature(wasi_ext))]
111 #![cfg_attr(not(feature = "std"), no_std)]
112 #![cfg_attr(feature = "rustc-dep-of-std", feature(core_intrinsics))]
113 #![cfg_attr(feature = "rustc-dep-of-std", feature(ip))]
115 all(not(feature = "rustc-dep-of-std"), core_intrinsics),
119 #![cfg_attr(not(feature = "all-apis"), allow(dead_code))]
127 #[cfg(not(feature = "rustc-dep-of-std"))]
204 // "runtime" is also a public API module, but it's only for libc-like users.