allow_export

Macro allow_export 

Source
macro_rules! allow_export {
    ($id_name:ident) => { ... };
}
Expand description

Setup the symbol for export from the main crate.

Makes the symbol exportable from the main crate via export_symbols. Before calling allow_export! the symbol must be output from the build script with one of the usual write_… macros.

§Parameters

  • $id: The symbol to setup for export.

§Example

build.rs

use rustifact::ToTokenStream;

fn main() {
   rustifact::write_static!(FOO, &'static str, "I'm exportable");
   rustifact::allow_export!(FOO);
}

src/lib.rs

rustifact::export_symbols!(FOO);

// The above line is equivalent to the declaration:
// pub static FOO: &'static str = "I'm exportable";