Skip to content

Possibility to be zero-cost on some platforms #20

Open
@ickk

Description

@ickk

It would be possible (maybe slightly cursed?) to implement NonMaxU32 (and larger) in terms of some stable standard library type that already has a niche at u32::MAX, removing the run-time costs.

There unfortunately are not a lot of these, but I found std::os::fd::BorrowedFd which is available in std on Unix platforms & WASI and has been stable since 1.63.0.

Proof of concept

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions