A low-level I/O ownership and borrowing library

Overview

This library introduces OwnedFd, BorrowedFd, and supporting types and traits, and corresponding features for Windows, which implement safe owning and borrowing I/O lifetime patterns.

This is associated with RFC 3128, the I/O Safety RFC, which proposes that this API be added to std, with the goal being to eventually replace RawFd etc. for most use cases.

Some features currently require nightly Rust, as they depend on rustc_attrs to perform niche optimizations needed for FFI use cases.

For a quick taste, check out the code examples:

  • hello, a basic demo of this API, doing low-level I/O manually, using the provided example FFI bindings
  • easy-conversions, demonstrating the from_into convenience feature for converting from an impl Into* into an impl From*.
  • portable-views, demonstrating the convenience feature which allows one to temporarily "view" a file descriptor as any owning type such as File
  • flexible-apis, demonstrating how to write library APIs that accept untyped I/O resources.
  • owning-wrapper, demonstrating how to implement a type which wraps an Owned* type.

The core of the API is very simple, and consists of two main types and three main traits:

pub struct BorrowedFd<'fd> { ... }
pub struct OwnedFd { ... }

pub trait AsFd { ... }
pub trait IntoFd { ... }
pub trait FromFd { ... }

impl AsRawFd for BorrowedFd<'_> { ... }
impl AsRawFd for OwnedFd { ... }
impl IntoRawFd for OwnedFd { ... }
impl FromRawFd for OwnedFd { ... }

impl Drop for OwnedFd { ... }

impl AsFd for BorrowedFd<'_> { ... }
impl AsFd for OwnedFd { ... }
impl IntoFd for OwnedFd { ... }
impl FromFd for OwnedFd { ... }

On Windows, there are Handle and Socket versions of every Fd thing, and a special OptionFileHandle type to cope with inconsistent error reporting in the Windows API.

Full API documentation:

The magic of transparency

Here's the fun part. BorrowedFd and OwnedFd are repr(transparent) and hold RawFd values, and Option and Option are FFI-safe (on nightly Rust), so they can all be used in FFI directly:

Option; pub fn read(fd: BorrowedFd<'_>, ptr: *mut c_void, size: size_t) -> ssize_t; pub fn write(fd: BorrowedFd<'_>, ptr: *const c_void, size: size_t) -> ssize_t; pub fn close(fd: OwnedFd) -> c_int; } ">
extern "C" {
    pub fn open(pathname: *const c_char, flags: c_int, ...) -> Option;
    pub fn read(fd: BorrowedFd<'_>, ptr: *mut c_void, size: size_t) -> ssize_t;
    pub fn write(fd: BorrowedFd<'_>, ptr: *const c_void, size: size_t) -> ssize_t;
    pub fn close(fd: OwnedFd) -> c_int;
}

With bindings like this, users never have to touch RawFd values. Of course, not all code will do this, but it is a fun feature for code that can. This is what motivates having BorrowedFd instead of just using &OwnedFd.

Note the use of Option as the return value of open, representing the fact that it can either succeed or fail.

Prior Art

There are several similar crates: fd, filedesc, filedescriptor, owned-fd, and unsafe-io.

Some of these provide additional features such as the ability to create pipes or sockets, to get and set flags, and to do read and write operations. io-lifetimes omits these features, leaving them to to be provided as separate layers on top.

Most of these crates provide ways to duplicate a file descriptor. io-lifetimes currently treats this as another feature than can be provided by a layer on top, though if there are use cases where this is a common operation, it could be added.

io-lifetimes's distinguishing features are its use of repr(transparent) to support direct FFI usage, niche optimizations so Option can support direct FFI usafe as well (on nightly Rust), lifetime-aware As*/Into*/From* traits which leverage Rust's lifetime system and allow safe and checked from_* and as_*/into_* functions, and powerful convenience features enabled by its underlying safety.

io-lifetimes also has full Windows support, as well as Unix/Windows portability abstractions, covering both file-like and socket-like types.

io-lifetimes's OwnedFd type is similar to fd's FileDesc. io-lifetimes doesn't have a close_on_drop parameter, and instead uses OwnedFd and BorrowedFd to represent dropping and non-dropping handles, respectively, in a way that is checked at compile time rather than runtime.

io-lifetimes's OwnedFd type is also similar to filedesc's FileDesc io-lifetimes's OwnedFd reserves the value -1, so it doesn't need to test for -1 in its Drop, and Option is the same size as OwnedFd (on nightly Rust).

io-lifetimes's OwnedFd type is also similar to owned-fd's OwnedFd. io-lifetimes doesn't implement Clone, because duplicating a file descriptor can fail due to OS process limits, while Clone is an infallible interface.

io-lifetimes's BorrowedFd is similar to owned-fd's FdRef, except it uses a lifetime parameter and PhantomData rather than transmuting a raw file descriptor value into a reference value.

io-lifetimes's convenience features are similar to those of unsafe-io, but io-lifetimes is built on its own As*/Into*/From* traits, rather than extending AsRaw*/IntoRaw*/FromRaw* with OwnsRaw, so they're simpler and safer to use. io-lifetimes doesn't include unsafe-io's *ReadWrite* or *HandleOrSocket* abstractions, and leaves these as features to be provided by separate layers on top.

Comments
  • Make views require dedicated `unsafe` marker traits.

    Make views require dedicated `unsafe` marker traits.

    Requiring Into and From conversions is not sufficient for FilelikeView and SocketlikeView, becuase there's no guarantee that the Into implementation will return the same handle as the From implementation. If a type allows its handle to be reassigned, that can lead to the old handle being freed twice, and the new handle being leaked.

    To fix this, introduce unsafe marker traits FilelikeViewType and SocketlikeViewType, and have FilelikeView and SocketlikeView require these traits.

    opened by sunfishcode 27
  • build: update async-std and disable default features

    build: update async-std and disable default features

    The unstable feature is not required due to dependency update. Default features are disabled to minimize dependency graph, which is particularly relevant for wasm32-wasi target, since default async-std feature set adds socket2 dependency, which does not support wasm32-wasi

    This change should also massively speed up compilation

    Before:

    io-lifetimes v1.0.0-rc0 (/home/rvolosatovs/src/github.com/sunfishcode/io-lifetimes)
    ├── async-std v1.12.0
    │   ├── async-channel v1.7.1
    │   │   ├── concurrent-queue v1.2.4
    │   │   │   └── cache-padded v1.2.0
    │   │   ├── event-listener v2.5.3
    │   │   └── futures-core v0.3.23
    │   ├── async-global-executor v2.2.0
    │   │   ├── async-channel v1.7.1 (*)
    │   │   ├── async-executor v1.4.1
    │   │   │   ├── async-task v4.3.0
    │   │   │   ├── concurrent-queue v1.2.4 (*)
    │   │   │   ├── fastrand v1.8.0
    │   │   │   │   └── instant v0.1.12
    │   │   │   │       └── cfg-if v1.0.0
    │   │   │   ├── futures-lite v1.12.0
    │   │   │   │   ├── fastrand v1.8.0 (*)
    │   │   │   │   ├── futures-core v0.3.23
    │   │   │   │   ├── futures-io v0.3.23
    │   │   │   │   ├── memchr v2.5.0
    │   │   │   │   ├── parking v2.0.0
    │   │   │   │   ├── pin-project-lite v0.2.9
    │   │   │   │   └── waker-fn v1.1.0
    │   │   │   ├── once_cell v1.13.1
    │   │   │   └── slab v0.4.7
    │   │   │       [build-dependencies]
    │   │   │       └── autocfg v1.1.0
    │   │   ├── async-io v1.8.0
    │   │   │   ├── concurrent-queue v1.2.4 (*)
    │   │   │   ├── futures-lite v1.12.0 (*)
    │   │   │   ├── log v0.4.17
    │   │   │   │   ├── cfg-if v1.0.0
    │   │   │   │   └── value-bag v1.0.0-alpha.9
    │   │   │   │       └── ctor v0.1.23 (proc-macro)
    │   │   │   │           ├── quote v1.0.21
    │   │   │   │           │   └── proc-macro2 v1.0.43
    │   │   │   │           │       └── unicode-ident v1.0.3
    │   │   │   │           └── syn v1.0.99
    │   │   │   │               ├── proc-macro2 v1.0.43 (*)
    │   │   │   │               ├── quote v1.0.21 (*)
    │   │   │   │               └── unicode-ident v1.0.3
    │   │   │   │       [build-dependencies]
    │   │   │   │       └── version_check v0.9.4
    │   │   │   ├── once_cell v1.13.1
    │   │   │   ├── parking v2.0.0
    │   │   │   ├── polling v2.3.0
    │   │   │   │   ├── cfg-if v1.0.0
    │   │   │   │   └── log v0.4.17 (*)
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── autocfg v1.1.0
    │   │   │   ├── slab v0.4.7 (*)
    │   │   │   ├── socket2 v0.4.4
    │   │   │   └── waker-fn v1.1.0
    │   │   │   [build-dependencies]
    │   │   │   └── autocfg v1.1.0
    │   │   ├── async-lock v2.5.0
    │   │   │   └── event-listener v2.5.3
    │   │   ├── blocking v1.2.0
    │   │   │   ├── async-channel v1.7.1 (*)
    │   │   │   ├── async-task v4.3.0
    │   │   │   ├── atomic-waker v1.0.0
    │   │   │   ├── fastrand v1.8.0 (*)
    │   │   │   ├── futures-lite v1.12.0 (*)
    │   │   │   └── once_cell v1.13.1
    │   │   ├── futures-lite v1.12.0 (*)
    │   │   ├── num_cpus v1.13.1
    │   │   │   └── libc v0.2.132
    │   │   └── once_cell v1.13.1
    │   ├── async-io v1.8.0 (*)
    │   ├── async-lock v2.5.0 (*)
    │   ├── async-process v1.5.0
    │   │   ├── cfg-if v1.0.0
    │   │   ├── event-listener v2.5.3
    │   │   ├── futures-lite v1.12.0 (*)
    │   │   └── once_cell v1.13.1
    │   │   [build-dependencies]
    │   │   └── autocfg v1.1.0
    │   ├── crossbeam-utils v0.8.11
    │   │   ├── cfg-if v1.0.0
    │   │   └── once_cell v1.13.1
    │   ├── futures-channel v0.3.23
    │   │   └── futures-core v0.3.23
    │   ├── futures-core v0.3.23
    │   ├── futures-io v0.3.23
    │   ├── futures-lite v1.12.0 (*)
    │   ├── gloo-timers v0.2.4
    │   │   ├── futures-channel v0.3.23 (*)
    │   │   ├── futures-core v0.3.23
    │   │   ├── js-sys v0.3.59
    │   │   │   └── wasm-bindgen v0.2.82
    │   │   │       ├── cfg-if v1.0.0
    │   │   │       └── wasm-bindgen-macro v0.2.82 (proc-macro)
    │   │   │           ├── quote v1.0.21 (*)
    │   │   │           └── wasm-bindgen-macro-support v0.2.82
    │   │   │               ├── proc-macro2 v1.0.43 (*)
    │   │   │               ├── quote v1.0.21 (*)
    │   │   │               ├── syn v1.0.99 (*)
    │   │   │               ├── wasm-bindgen-backend v0.2.82
    │   │   │               │   ├── bumpalo v3.11.0
    │   │   │               │   ├── log v0.4.17
    │   │   │               │   │   ├── cfg-if v1.0.0
    │   │   │               │   │   └── value-bag v1.0.0-alpha.9
    │   │   │               │   │       └── ctor v0.1.23 (proc-macro) (*)
    │   │   │               │   │       [build-dependencies]
    │   │   │               │   │       └── version_check v0.9.4
    │   │   │               │   ├── once_cell v1.13.1
    │   │   │               │   ├── proc-macro2 v1.0.43 (*)
    │   │   │               │   ├── quote v1.0.21 (*)
    │   │   │               │   ├── syn v1.0.99 (*)
    │   │   │               │   └── wasm-bindgen-shared v0.2.82
    │   │   │               └── wasm-bindgen-shared v0.2.82
    │   │   └── wasm-bindgen v0.2.82 (*)
    │   ├── kv-log-macro v1.0.7
    │   │   └── log v0.4.17 (*)
    │   ├── log v0.4.17 (*)
    │   ├── memchr v2.5.0
    │   ├── once_cell v1.13.1
    │   ├── pin-project-lite v0.2.9
    │   ├── pin-utils v0.1.0
    │   ├── slab v0.4.7 (*)
    │   └── wasm-bindgen-futures v0.4.32
    │       ├── cfg-if v1.0.0
    │       ├── js-sys v0.3.59 (*)
    │       └── wasm-bindgen v0.2.82 (*)
    └── libc v0.2.132
    

    After:

    io-lifetimes v1.0.0-rc0 (/home/rvolosatovs/src/github.com/sunfishcode/io-lifetimes)
    ├── async-std v1.12.0
    └── libc v0.2.132
    
    opened by rvolosatovs 15
  • error[E0554]: `#![feature]` may not be used on the stable release channel

    error[E0554]: `#![feature]` may not be used on the stable release channel

    through clap -> terminal_size -> rustix -> io-lifetimes we are using this crate in the crates.io codebase. https://github.com/rust-lang/crates.io/pull/5436 had updated the lockfile, causing us to upgrade from v0.7.4 to 0.7.5. rustix was also updated from v0.35.12 to v0.35.13 at the same time.

    after this update I'm no longer able to compile the codebase locally on macOS:

    $ cargo check
        Checking io-lifetimes v0.7.5
    error[E0554]: `#![feature]` may not be used on the stable release channel
      --> /Users/tbieniek/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-0.7.5/src/lib.rs:31:26
       |
    31 | #![cfg_attr(rustc_attrs, feature(rustc_attrs))]
       |                          ^^^^^^^^^^^^^^^^^^^^
    
    For more information about this error, try `rustc --explain E0554`.
    error: could not compile `io-lifetimes` due to previous error
    

    note that on CI and the production servers the codebase compiles and runs fine for some reason. any clue what might be causing this?

    opened by Turbo87 9
  • 1.0.2 does not compile on wasm32-unknown-unknown

    1.0.2 does not compile on wasm32-unknown-unknown

    1.0.2 does not compile

    error[E0432]: unresolved imports `portability::AsFilelike`, `portability::AsSocketlike`, `portability::BorrowedFilelike`, `portability::BorrowedSocketlike`, `portability::FromFilelike`, `portability::FromSocketlike`, `portability::IntoFilelike`, `portability::IntoSocketlike`, `portability::OwnedFilelike`, `portability::OwnedSocketlike`
       --> ~/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/io-lifetimes-1.0.2/src/lib.rs:156:5
        |
    156 |     AsFilelike, AsSocketlike, BorrowedFilelike, BorrowedSocketlike, FromFilelike, FromSocketlike,
        |     ^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^^ no `FromSocketlike` in `portability`
        |     |           |             |                 |                   |
        |     |           |             |                 |                   no `FromFilelike` in `portability`
        |     |           |             |                 no `BorrowedSocketlike` in `portability`
        |     |           |             no `BorrowedFilelike` in `portability`
        |     |           no `AsSocketlike` in `portability`
        |     no `AsFilelike` in `portability`
    157 |     IntoFilelike, IntoSocketlike, OwnedFilelike, OwnedSocketlike,
        |     ^^^^^^^^^^^^  ^^^^^^^^^^^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^ no `OwnedSocketlike` in `portability`
        |     |             |               |
        |     |             |               no `OwnedFilelike` in `portability`
        |     |             no `IntoSocketlike` in `portability`
        |     no `IntoFilelike` in `portability`
    
    error[E0432]: unresolved imports `crate::raw::AsRawFilelike`, `crate::raw::AsRawSocketlike`, `crate::raw::FromRawFilelike`, `crate::raw::FromRawSocketlike`, `crate::raw::IntoRawFilelike`, `crate::raw::IntoRawSocketlike`, `crate::raw::RawFilelike`, `crate::raw::RawSocketlike`
      --> ~/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/io-lifetimes-1.0.2/src/views.rs:9:5
       |
    9  |     AsRawFilelike, AsRawSocketlike, FromRawFilelike, FromRawSocketlike, IntoRawFilelike,
       |     ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^ no `IntoRawFilelike` in `raw`
       |     |              |                |                |
       |     |              |                |                no `FromRawSocketlike` in `raw`
       |     |              |                no `FromRawFilelike` in `raw`
       |     |              no `AsRawSocketlike` in `raw`
       |     no `AsRawFilelike` in `raw`
    10 |     IntoRawSocketlike, RawFilelike, RawSocketlike,
       |     ^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^^^ no `RawSocketlike` in `raw`
       |     |                  |
       |     |                  no `RawFilelike` in `raw`
       |     no `IntoRawSocketlike` in `raw`
    
    opened by Dirreke 5
  • What is the goal of this crate in terms of being used as part of a public API?

    What is the goal of this crate in terms of being used as part of a public API?

    On a project I'm working on we have some crate for which it would make a lot of sense to have OwnedFd as part of its public API, however we don't want to bump our MSRV to 1.63 just yet.

    One of the options we are considering is to publicly depend on io-lifetimes and use its types and traits instead. However I'd like to be sure if this is the way this library is meant to be used? Looking at #38, it appears that the main focus of the project is to actually migrate the ecosystem to the std types and traits.

    opened by vberger 4
  • Don't require nightly for std-imported usage

    Don't require nightly for std-imported usage

    With Rust 1.63.0 stabilizing io_safety, this crate should use autocfg to switch to the std types by default when the version is greater than or equal to 1.63.0, and the line importing the nightly feature should be removed.

    opened by notgull 4
  • Docs don't match type niche

    Docs don't match type niche

    Shouldn't the OptionFileHandle use *mut c_void and not NonNull, since null is a valid value?

    https://github.com/sunfishcode/io-experiment/blob/41303e0015f8a751d3ec86c9105984a47f49d989/src/types.rs#L153-L166

    opened by programmerjake 4
  • Disable async-std and other dependencies on WASI.

    Disable async-std and other dependencies on WASI.

    Move the async-std, tokio, socket2, and mio dependencies into a not(target_os = "wasi") dependency section. This fixes the problem that the default features in async-std, which we need, depend on socket2, which doesn't work on WASI yet.

    The tradeoff here is that WASI users won't be able to make use of io-lifetimes' impls for these third-party crate types. But we are working to add these traits upstream, which will eventually make this unnecessary.

    opened by sunfishcode 2
  • Remove use of `rustc_attrs`, which is no longer needed.

    Remove use of `rustc_attrs`, which is no longer needed.

    This io-lifetimes crate no longer needs this rustc_attrs code. On Rust versions where io_safety is stabilized, we use the version in std (which uses rustc_attrs internally). On Rust versions where it's not, rustc_attrs isn't available to user code anyway, since it's not a stable language feature.

    This might fix #51.

    opened by sunfishcode 1
  • fix: use correct traits in wasi tests

    fix: use correct traits in wasi tests

    Note, that tests still fail on wasm32-wasi, but at least the niche-optimizations.rs test compiles now.

    $ cargo --version && cargo test --target wasm32-wasi
    cargo 1.64.0-nightly (85b500cca 2022-07-24)
       Compiling io-lifetimes v1.0.0-rc0 (/home/rvolosatovs/src/github.com/sunfishcode/io-lifetimes)
    warning: unused import: `io_lifetimes::example_ffi::*`
     --> examples/hello.rs:7:5
      |
    7 | use io_lifetimes::example_ffi::*;
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: `#[warn(unused_imports)]` on by default
    
    warning: unused imports: `Write`, `fs::File`, `self`
      --> examples/hello.rs:10:5
       |
    10 |     fs::File,
       |     ^^^^^^^^
    11 |     io::{self, Write},
       |          ^^^^  ^^^^^
    
    warning: `io-lifetimes` (example "hello") generated 2 warnings
    error[E0277]: the trait bound `OwnedFd: From<ChildStdout>` is not satisfied
       --> examples/easy-conversions.rs:19:45
        |
    19  |     let mut file = File::from_into_filelike(child.stdout.take().unwrap());
        |                    ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<ChildStdout>` is not implemented for `OwnedFd`
        |                    |
        |                    required by a bound introduced by this call
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<File>>
                  <OwnedFd as From<TcpListener>>
                  <OwnedFd as From<TcpStream>>
                  <OwnedFd as From<UdpSocket>>
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `ChildStdout`
        = note: required because of the requirements on the impl of `IntoFilelike` for `ChildStdout`
    note: required by a bound in `from_into_filelike`
       --> /home/rvolosatovs/src/github.com/sunfishcode/io-lifetimes/src/portability.rs:395:34
        |
    395 |     fn from_into_filelike<Owned: IntoFilelike>(owned: Owned) -> Self;
        |                                  ^^^^^^^^^^^^ required by this bound in `from_into_filelike`
    
    error[E0599]: the method `as_filelike_view` exists for struct `Stdout`, but its trait bounds were not satisfied
      --> examples/portable-views.rs:17:27
       |
    17 |     let metadata = stdout.as_filelike_view::<File>().metadata()?;
       |                           ^^^^^^^^^^^^^^^^ method cannot be called on `Stdout` due to unsatisfied trait bounds
       |
       = note: the following trait bounds were not satisfied:
               `Stdout: AsFd`
               which is required by `Stdout: AsFilelike`
    
    warning: unused import: `io_lifetimes::AsFilelike`
     --> examples/portable-views.rs:4:5
      |
    4 | use io_lifetimes::AsFilelike;
      |     ^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: `#[warn(unused_imports)]` on by default
    
    For more information about this error, try `rustc --explain E0277`.
    For more information about this error, try `rustc --explain E0599`.
    warning: `io-lifetimes` (example "portable-views") generated 1 warning
    error: could not compile `io-lifetimes` due to previous error; 1 warning emitted
    warning: build failed, waiting for other jobs to finish...
    error: could not compile `io-lifetimes` due to previous error
    
    opened by rvolosatovs 1
  • Update for io_safety being stabilized.

    Update for io_safety being stabilized.

    io_safety is now stable in Rust 1.63! This PR updates io-lifetimes to use the standard library types and traits when available, and use its own types and traits on older Rust versions.

    The traits FromFd and IntoFd are now marked as deprecated. These are replaced by From<OwnedFd> and From<...> for OwnedFd in the standard library, and users should migrate accordingly.

    opened by sunfishcode 1
  • Breaking change in 1.0.1

    Breaking change in 1.0.1

    1.0.0 is fine but 1.0.1 does not compile

    error[E0277]: the trait bound `Socket: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:236:13
        |
    236 | unsafe impl SocketlikeViewType for socket2::Socket {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `Socket`
        |
        = help: the following other types implement trait `From<T>`:
                  <Socket as From<std::net::TcpListener>>
                  <Socket as From<std::net::TcpStream>>
                  <Socket as From<std::net::UdpSocket>>
                  <Socket as From<std::os::unix::net::UnixDatagram>>
                  <Socket as From<std::os::unix::net::UnixListener>>
                  <Socket as From<std::os::unix::net::UnixStream>>
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:38
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                      ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<Socket>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:236:13
        |
    236 | unsafe impl SocketlikeViewType for socket2::Socket {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<Socket>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `Socket`
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:55
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                                       ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `mio::net::TcpStream: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:258:13
        |
    258 | unsafe impl SocketlikeViewType for mio::net::TcpStream {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::net::TcpStream`
        |
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:38
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                      ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::net::TcpStream>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:258:13
        |
    258 | unsafe impl SocketlikeViewType for mio::net::TcpStream {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<mio::net::TcpStream>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::net::TcpStream`
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:55
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                                       ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `mio::net::TcpListener: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:260:13
        |
    260 | unsafe impl SocketlikeViewType for mio::net::TcpListener {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::net::TcpListener`
        |
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:38
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                      ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::net::TcpListener>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:260:13
        |
    260 | unsafe impl SocketlikeViewType for mio::net::TcpListener {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<mio::net::TcpListener>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::net::TcpListener`
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:55
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                                       ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `mio::net::UdpSocket: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:262:13
        |
    262 | unsafe impl SocketlikeViewType for mio::net::UdpSocket {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::net::UdpSocket`
        |
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:38
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                      ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::net::UdpSocket>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:262:13
        |
    262 | unsafe impl SocketlikeViewType for mio::net::UdpSocket {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<mio::net::UdpSocket>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::net::UdpSocket`
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:55
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                                       ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `mio::net::UnixDatagram: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:265:13
        |
    265 | unsafe impl SocketlikeViewType for mio::net::UnixDatagram {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::net::UnixDatagram`
        |
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:38
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                      ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::net::UnixDatagram>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:265:13
        |
    265 | unsafe impl SocketlikeViewType for mio::net::UnixDatagram {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<mio::net::UnixDatagram>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::net::UnixDatagram`
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:55
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                                       ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `mio::net::UnixListener: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:268:13
        |
    268 | unsafe impl SocketlikeViewType for mio::net::UnixListener {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::net::UnixListener`
        |
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:38
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                      ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::net::UnixListener>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:268:13
        |
    268 | unsafe impl SocketlikeViewType for mio::net::UnixListener {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<mio::net::UnixListener>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::net::UnixListener`
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:55
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                                       ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `mio::net::UnixStream: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:271:13
        |
    271 | unsafe impl SocketlikeViewType for mio::net::UnixStream {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::net::UnixStream`
        |
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:38
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                      ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::net::UnixStream>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:271:13
        |
    271 | unsafe impl SocketlikeViewType for mio::net::UnixStream {}
        |             ^^^^^^^^^^^^^^^^^^ the trait `From<mio::net::UnixStream>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::net::UnixStream`
    note: required by a bound in `SocketlikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:43:55
        |
    43  | pub unsafe trait SocketlikeViewType: FromSocketlike + IntoSocketlike {}
        |                                                       ^^^^^^^^^^^^^^ required by this bound in `SocketlikeViewType`
    
    error[E0277]: the trait bound `mio::unix::pipe::Receiver: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:274:13
        |
    274 | unsafe impl FilelikeViewType for mio::unix::pipe::Receiver {}
        |             ^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::unix::pipe::Receiver`
        |
        = help: the following other types implement trait `From<T>`:
                  <mio::unix::pipe::Receiver as From<ChildStderr>>
                  <mio::unix::pipe::Receiver as From<ChildStdout>>
    note: required by a bound in `FilelikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:33:36
        |
    33  | pub unsafe trait FilelikeViewType: FromFilelike + IntoFilelike {}
        |                                    ^^^^^^^^^^^^ required by this bound in `FilelikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::unix::pipe::Receiver>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:274:13
        |
    274 | unsafe impl FilelikeViewType for mio::unix::pipe::Receiver {}
        |             ^^^^^^^^^^^^^^^^ the trait `From<mio::unix::pipe::Receiver>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::unix::pipe::Receiver`
    note: required by a bound in `FilelikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:33:51
        |
    33  | pub unsafe trait FilelikeViewType: FromFilelike + IntoFilelike {}
        |                                                   ^^^^^^^^^^^^ required by this bound in `FilelikeViewType`
    
    error[E0277]: the trait bound `mio::unix::pipe::Sender: From<OwnedFd>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:277:13
        |
    277 | unsafe impl FilelikeViewType for mio::unix::pipe::Sender {}
        |             ^^^^^^^^^^^^^^^^ the trait `From<OwnedFd>` is not implemented for `mio::unix::pipe::Sender`
        |
        = help: the trait `From<ChildStdin>` is implemented for `mio::unix::pipe::Sender`
    note: required by a bound in `FilelikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:33:36
        |
    33  | pub unsafe trait FilelikeViewType: FromFilelike + IntoFilelike {}
        |                                    ^^^^^^^^^^^^ required by this bound in `FilelikeViewType`
    
    error[E0277]: the trait bound `OwnedFd: From<mio::unix::pipe::Sender>` is not satisfied
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:277:13
        |
    277 | unsafe impl FilelikeViewType for mio::unix::pipe::Sender {}
        |             ^^^^^^^^^^^^^^^^ the trait `From<mio::unix::pipe::Sender>` is not implemented for `OwnedFd`
        |
        = help: the following other types implement trait `From<T>`:
                  <OwnedFd as From<ChildStderr>>
                  <OwnedFd as From<ChildStdin>>
                  <OwnedFd as From<ChildStdout>>
                  <OwnedFd as From<File>>
                  <OwnedFd as From<PidFd>>
                  <OwnedFd as From<PipeReader>>
                  <OwnedFd as From<PipeWriter>>
                  <OwnedFd as From<std::net::TcpListener>>
                and 5 others
        = note: required because of the requirements on the impl of `Into<OwnedFd>` for `mio::unix::pipe::Sender`
    note: required by a bound in `FilelikeViewType`
       --> /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/io-lifetimes-1.0.1/src/views.rs:33:51
        |
    33  | pub unsafe trait FilelikeViewType: FromFilelike + IntoFilelike {}
        |                                                   ^^^^^^^^^^^^ required by this bound in `FilelikeViewType`
    
    For more information about this error, try `rustc --explain E0277`.
    error: could not compile `io-lifetimes` due to 18 previous errors
    
    opened by ETKNeil 1
  • Quest: Gradually migrate the Rust ecosystem to I/O safety

    Quest: Gradually migrate the Rust ecosystem to I/O safety

    As mentioned in the RFC, migration to I/O safety will be a gradual process. I'm laying out a roadmap here, with todo items, to help organize the process. If anyone is interested in helping with any of the items in this process, has ideas of things we should add, or has any questions about anything, please post in this issue! I'll add names to the todo items to track who's working on what.

    The first steps are:

    Once the feature reaches stable, the next step will be to contribute AsFd, From<OwnedFd> and From<T> for OwnedFd impls to popular types in the ecosystem. These changes are semver compatible, though they do have MSRV considerations.

    • std already has impls for all its own types.
    • I'll migrate crates I maintain:
      • [x] cap-std (@sunfishcode)
      • [x] io-streams (@sunfishcode)
      • [x] io-extras (@sunfishcode)
    • We'll want to contribute impls to upstream crates for the types that io-lifetimes has impls for; these can follow the implementations in impls_*.rs files in the src directory.
      • [ ] async-std (async-rs/async-std#1036)
      • [x] fs-err (https://github.com/andrewhickman/fs-err/pull/39)
      • [ ] mio (tokio-rs/mio#1588; waiting for msrv bump)
      • [x] os_pipe (https://github.com/oconnor663/os_pipe.rs/pull/25)
      • [ ] tokio (waiting for msrv bump)
      • [ ] socket2 (rust-lang/socket2#325; expected to be released in 0.5 semver bump due to MSRV change)
      • [x] async-net (smol-rs/async-net#21)
    • There are likely other crates beyond what io-lifetimes happened to add impls for. If a type implements AsRawFd, FromRawFd, and/or IntoRawFd, it usually wants AsFd, From<OwnedFd>, and/or From<T> for OwnedFd, respectively. And similar for Windows with Handle and Socket in for Fd.
      • [ ] TODO: add others here

    To help crates that are already using io-lifetimes, such as rustix:

    • [x] Update io-lifetimes to re-export std's types and traits by default when they're available in a stable rustc. (@sunfishcode) (https://github.com/sunfishcode/io-lifetimes/pull/41)

    Once "enough" popular types have added the new impls, we can start migrating APIs to use the new traits, such as using AsFd in place of AsRawFd. When doing so, any functions that accept raw file-descriptor arguments should be changed to unsafe as well. These changes may require a semver bump. They may require a Minimum Supported Rust Version bump too, though another option is to use io-lifetimes once the change to have it re-export std's types and traits by default lands.

    • [ ] fd-lock (@sunfishcode) (https://github.com/yoshuawuyts/fd-lock/pull/14)
    • [ ] terminal_size
    • [ ] TODO: add others here
    help wanted good first issue 
    opened by sunfishcode 5
Owner
Dan Gohman
I'm working on Wasmtime, WASI, and lots of things related to WebAssembly.
Dan Gohman
A low-ish level tool for easily writing and hosting WASM based plugins.

A low-ish level tool for easily writing and hosting WASM based plugins. The goal of wasm_plugin is to make communicating across the host-plugin bounda

Alec Deason 62 Sep 20, 2022
A Rust framework to develop and use plugins within your project, without worrying about the low-level details.

VPlugin: A plugin framework for Rust. Website | Issues | Documentation VPlugin is a Rust framework to develop and use plugins on applications and libr

VPlugin 11 Dec 31, 2022
Low level access to ATmega32U4 registers in Rust

Deprecation Note: This crate will soon be deprecated in favor of avr-device. The approach of generating the svd from hand-written register definitions

Rahix 9 Jan 27, 2021
A high level diffing library for rust based on diffs

Similar: A Diffing Library Similar is a dependency free crate for Rust that implements different diffing algorithms and high level interfaces for it.

Armin Ronacher 617 Dec 30, 2022
Mononym is a library for creating unique type-level names for each value in Rust.

Mononym is a library for creating unique type-level names for each value in Rust.

MaybeVoid 52 Dec 16, 2022
Simple procedural macros `tnconst![...]`, `pconst![...]`, `nconst![...]` and `uconst![...]` that returns the type level integer from `typenum` crate.

typenum-consts Procedural macros that take a literal integer (or the result of an evaluation of simple mathematical expressions or an environment vari

Jim Chng 3 Mar 30, 2024
Rust mid-level IR Abstract Interpreter

MIRAI MIRAI is an abstract interpreter for the Rust compiler's mid-level intermediate representation (MIR). It is intended to become a widely used sta

Facebook Experimental 793 Jan 2, 2023
High level rust abstractions for the libretro API

libretro-rs Design Philosophy The approach to this crate can best be summarized as wanting to expose all functionality, even if not idiomatically. The

null 9 Dec 25, 2022
High-level documentation for rerun

rerun-docs This is the high-level documentation for rerun that is hosted at https://www.rerun.io/docs Other documentation API-level documentation for

rerun.io 9 Feb 19, 2023
Let Tauri's transparent background rendering window be stacked on Bevy's rendering window in real time to run the game with native-level performance!

Native Bevy with Tauri HUD DEMO 将 Tauri 的透明背景渲染窗口实时叠在 Bevy 的渲染窗口上,以使用原生级别性能运行游戏! Let Tauri's transparent background rendering window be stacked on Bev

伊欧 3 Mar 25, 2024
A library to compile USDT probes into a Rust library

sonde sonde is a library to compile USDT probes into a Rust library, and to generate a friendly Rust idiomatic API around it. Userland Statically Defi

Ivan Enderlin 40 Jan 7, 2023
A Diablo II library for core and simple client functionality, written in Rust for performance, safety and re-usability

A Diablo II library for core and simple client functionality, written in Rust for performance, safety and re-usability

null 4 Nov 30, 2022
UnTeX is both a library and an executable that allows you to manipulate and understand TeX files.

UnTeX UnTeX is both a library and an executable that allows you to manipulate and understand TeX files. Usage Executable If you wish to use the execut

Jérome Eertmans 1 Apr 5, 2022
An opinionated, practical color management library for games and graphics.

colstodian An opinionated color management library built on top of kolor. Introduction colstodian is a practical color management library for games an

Gray Olson 27 Dec 7, 2022
miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

miette is a diagnostic library for Rust. It includes a series of traits/protocols that allow you to hook into its error reporting facilities, and even write your own error reports!

Kat Marchán 1.2k Jan 1, 2023
Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.

Jerel Unruh 70 Dec 13, 2022
sgmlish is a library for parsing, manipulating and deserializing SGML.

sgmlish is a library for parsing, manipulating and deserializing SGML. It's not intended to be a full-featured implementation of the SGML spec

Daniel Luz 6 Dec 14, 2022
A rust library that makes reading and writing memory of the Dolphin emulator easier.

dolphin-memory-rs A crate for reading from and writing to the emulated memory of Dolphin in rust. A lot of internals here are directly based on aldela

Madison Barry 4 Jul 19, 2022
This article is about the unsound api which I found in owning_ref. Owning_ref is a library that has 11 million all-time downloads and 60 reverse dependencies.

Unsoundness in owning_ref This article is about the unsound api which I found in owning_ref. Owning_ref is a library that has 11 million all-time down

Noam Ta Shma 20 Aug 3, 2022