Macro module_variable

Source
macro_rules! module_variable {
    ($module:expr, $name:expr, $ty:ty) => { ... };
    ($module:expr, $name:expr, $ty:ty, $value:expr) => { ... };
}
Expand description

Add module-level variable, the first argument module_variable! receives is the full module name; the second argument is the name of the variable, the third argument is the type of the variable, and (optional) the fourth argument is the default value of the variable.

pyo3_stub_gen::module_variable!("module.name", "CONSTANT1", usize);
pyo3_stub_gen::module_variable!("module.name", "CONSTANT2", usize, 123);