RIOT-OS / rust-riot-wrappers

The `riot-wrappers` crate, which enables high-level access to RIOT from the Rust programming language
13 stars 10 forks source link

Error enhancements #128

Open chrysn opened 1 month ago

chrysn commented 1 month ago

A goal with the NegativeError type is to tell the compiler that all positive values are niches. While that's impossible or at least hard and compile time heavy, advertising the niche at 0 to the compiler is easy enough.

Along with this comes a documentation extension and minor internal refactorings.

chrysn commented 1 month ago

Converted to a draft while waiting for https://github.com/RIOT-OS/rust-riot-sys/pull/49 -- then, we can add core::error::Error (with a fallback to numeric representation) here too.

chrysn commented 1 month ago

Now also implements Display and Error (although the Display implementation is only good if the module tiny_strerror is available)