Lines Matching +full:test +full:- +full:msrv
2 <h1><code>io-lifetimes</code></h1>
5 <strong>A low-level I/O ownership and borrowing library</strong>
9 …"https://github.com/sunfishcode/io-lifetimes/actions?query=workflow%3ACI"><img src="https://github…
10 …<a href="https://crates.io/crates/io-lifetimes"><img src="https://img.shields.io/crates/v/io-lifet…
11 …<a href="https://docs.rs/io-lifetimes"><img src="https://docs.rs/io-lifetimes/badge.svg" alt="docs…
25 - [hello], a basic demo of this API, doing low-level I/O manually, using the
27 - [easy-conversions], demonstrating the `from_into` convenience feature for
29 - [portable-views], demonstrating the convenience feature which allows one
31 - [flexible-apis], demonstrating how to write library APIs that accept
33 - [owning-wrapper], demonstrating how to implement a type which wraps an
36 [hello]: https://github.com/sunfishcode/io-lifetimes/blob/main/examples/hello.rs
37 [easy-conversions]: https://github.com/sunfishcode/io-lifetimes/blob/main/examples/easy-conversions…
38 [portable-views]: https://github.com/sunfishcode/io-lifetimes/blob/main/examples/portable-views.rs
39 [flexible-apis]: https://github.com/sunfishcode/io-lifetimes/blob/main/examples/flexible-apis.rs
40 [owning-wrapper]: https://github.com/sunfishcode/io-lifetimes/blob/main/examples/owning-wrapper.rs
41 [provided example FFI bindings]: https://github.com/sunfishcode/io-lifetimes/blob/main/src/example_…
75 FFI-safe (on Rust >= 1.63), so they can all be used in FFI [directly]:
77 [directly]: https://github.com/sunfishcode/io-lifetimes/blob/main/src/example_ffi.rs
81 pub fn open(pathname: *const c_char, flags: c_int, ...) -> Option<OwnedFd>;
82 pub fn read(fd: BorrowedFd<'_>, ptr: *mut c_void, size: size_t) -> ssize_t;
83 pub fn write(fd: BorrowedFd<'_>, ptr: *const c_void, size: size_t) -> ssize_t;
84 pub fn close(fd: OwnedFd) -> c_int;
98 io-lifetimes will use and re-export the standard-library types and traits. With
99 older versions, io-lifetimes defines its own copy of these types and traits.
101 io-lifetimes also includes several features which are not (yet?) in std,
105 [views]: https://docs.rs/io-lifetimes/*/io_lifetimes/views/index.html
112 [owned-fd](https://crates.io/crates/owned-fd), and
113 [unsafe-io](https://crates.io/crates/unsafe-io).
117 io-lifetimes omits these features, leaving them to to be provided as separate
120 Most of these crates provide ways to duplicate a file descriptor. io-lifetimes
125 io-lifetimes's distinguishing features are its use of `repr(transparent)`
127 FFI usafe as well (on Rust >= 1.63), lifetime-aware `As*`/`Into*`/`From*`
132 io-lifetimes also has full Windows support, as well as Unix/Windows
133 portability abstractions, covering both file-like and socket-like types.
135 io-lifetimes's [`OwnedFd`] type is similar to
137 [`FileDesc`](https://docs.rs/fd/0.2.3/fd/struct.FileDesc.html). io-lifetimes
139 [`BorrowedFd`] to represent dropping and non-dropping handles, respectively, in
142 io-lifetimes's [`OwnedFd`] type is also similar to
145 io-lifetimes's `OwnedFd` reserves the value -1, so it doesn't need to test for
146 `-1` in its `Drop`, and `Option<OwnedFd>` (on Rust >= 1.63) is the same size
149 io-lifetimes's [`OwnedFd`] type is also similar to
150 [owned-fd](https://crates.io/crates/owned-fd)'s
151 [`OwnedFd`](https://docs.rs/owned-fd/0.1.0/owned_fd/struct.OwnedFd.html).
152 io-lifetimes doesn't implement `Clone`, because duplicating a file descriptor
155 io-lifetimes's [`BorrowedFd`] is similar to
156 [owned-fd](https://crates.io/crates/owned-fd)'s
157 [`FdRef`](https://docs.rs/owned-fd/0.1.0/owned_fd/struct.FdRef.html), except it
161 io-lifetimes's convenience features are similar to those of
162 [unsafe-io](https://crates.io/crates/unsafe-io), but io-lifetimes is built on
165 [`OwnsRaw`](https://docs.rs/unsafe-io/0.6.9/unsafe_io/trait.OwnsRaw.html), so
166 they're simpler and safer to use. io-lifetimes doesn't include unsafe-io's
170 ## Minimum Supported Rust Version (MSRV)
177 [`OwnedFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/struct.OwnedFd.html
178 [`BorrowedFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/struct.BorrowedFd.html
179 [RFC 3128]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md