Closed jhwgh1968 closed 4 years ago
I find that rhai_mod
must have a parameters list. That is, #[rhai_mod]
is an error, but #[rhai_mod()]
is accepted.
That is currently not a surprise, since there is no reason to have it without attributes in the current version.
I do intend to change that, once I implement a series of attributes for fine-grained "does this export" behavior.
That is currently not a surprise, since there is no reason to have it without attributes in the current version.
So, will a sub-module be always exported if it is pub mod
? The rhai_mod
attribute is only used to rename it?
So, will a sub-module be always exported if it is
pub mod
? Therhai_mod
attribute is only used to rename it?
Currently, that is correct.
Don't forget a variation of rhai_generate
that adds the function directly into an existing module instead of creating a new one. This will help cut down a lot on unnecessary module creation.
Don't forget a variation of
rhai_generate
that adds the function directly into an existing module instead of creating a new one. This will help cut down a lot on unnecessary module creation.
I have it on my list (it's the item about adding to an existing module). I have some questions, but I'll ask them when I get there.
This allows modules to be nested, and set attributes with
rhai_mod
, similar torhai_fn
:However, this does not implement
#[cfg(...)]
block handling yet. That will be complex enough to be its own PR.