Crates.io | dynpath |
lib.rs | dynpath |
version | 0.1.4 |
source | src |
created_at | 2022-04-25 04:49:16.778779 |
updated_at | 2022-04-25 18:26:08.313136 |
description | An attribute macro to specify a path to a module dynamically. |
homepage | https://github.com/danakj/dynpath |
repository | https://github.com/danakj/dynpath |
max_upload_size | |
id | 573608 |
size | 17,675 |
This crate provides a #[dynpath()]
macro that can be placed on a mod
statement, and which points the module to a dynamic path.
The primary purpose of this crate is to include bindgen-generated bindings
without an include!()
statement. This allows for code completion and
cross-references.
The macro takes a single parameter which is the name of an environment variable
to read the path from, and it appends the module name and .rs
extension onto
the contents of the variable.
// Turns into `#[path = "whatever/is/in/OUT_DIR/bindings.rs"]`.
#[dynpath("OUT_DIR")]
mod bindings;
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in dynpath by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.