Uses old Rust 2015
0.0.2 |
|
---|---|
0.0.1 |
|
#132 in #escaping
4KB
unsafesc
home | https://github.com/realtable/unsafesc |
---|---|
docs | https://docs.rs/unsafesc |
cargo | https://crates.io/crates/unsafesc |
build | https://travis-ci.com/realtable/unsafesc |
Summary
The unsafesc
library provides an interface to Rust's four "unsafe
superpowers", namely:
- dereferencing a raw pointer,
- calling an unsafe function or method,
- accessing or modifying a mutable static variable, and
- implementing an unsafe trait
If you were using regular (safe) Rust you wouldn't be able to use any of these unsafe functions because they have been "locked away" by the compiler. Alternatively, unsafe Rust enables them, but you have to make sure all the unsafe code doesn't have any undefined behaviour. You can also only use unsafe code/functions within other unsafe functions.
The unsafesc
package provides the best of both worlds, i.e. providing access
to unsafe superpowers while taking care of undefined behaviour. It also unlocks
these superpowers from implementation within just unsafe functions.
Installation
cargo install unsafesc
Usage
In its current form, unsafesc
is a placeholder package. In future its features
will all be implemented, but for now there aren't any.