Crates.io | exclusive |
lib.rs | exclusive |
version | 0.1.0 |
source | src |
created_at | 2019-05-04 13:31:54.788199 |
updated_at | 2019-05-04 13:31:54.788199 |
description | Place code into an exclusive context that won't collide with another context. |
homepage | https://github.com/nvzqz/exclusive-rs |
repository | https://github.com/nvzqz/exclusive-rs |
max_upload_size | |
id | 131998 |
size | 21,066 |
A procedural macro for wrapping code in a collision-free context.
This crate is available on crates.io and
can be used by adding the following to your project's
Cargo.toml
:
[dependencies]
exclusive = "0.1.0"
and this to your crate root (main.rs
or lib.rs
):
#[macro_use]
extern crate exclusive;
The exclusive!
macro allows for placing blocks of code in a context that
won't collide with other calls to the macro in the same namespace:
exclusive! {
let x = 20;
let y = 30;
}
exclusive! {
// This code doesn't actually run
println!("Hello, world!");
}
This project was made to be used by
static_assertions
to prevent
different assertions from colliding with the same identifier.
See CHANGELOG.md
for a complete list of what has changed from one version to another.
This project is released under either:
at your choosing.