macro_rules! eqlog_mod {
($(#[$attr:meta])* $vis:vis $modname:ident) => { ... };
($(#[$attr:meta])* $vis:vis $modname:ident, $source:expr) => { ... };
}Expand description
Declare an eqlog module.
ยงExamples
The following simple version declares a module foo whose contents correspond src/foo.eqlog.
use eqlog_runtime::eqlog_mod;
eqlog_mod!(foo);This variant does not work for eqlog in proper subdirectories of src.
For example, it will not work for src/bar/baz.eqlog.
For such eqlog files, the following invocation of the eqlog_mod macro must be used:
eqlog_mod!(baz, "/bar/baz.rs")This declares a submodule baz in the current module whose contents correspond to
src/bar/baz.eqlog.
As before, the first argument is the rust module name.
The second argument is the path of the eqlog file relative to the src directory, but with the
.rs extension instead of .eqlog.
The path must start with a slash.
It is recommended that the rust module name agrees with the eqlog file name, and that the
declaration above is in src/bar/mod.rs or in src/bar.rs.
This results in the module path bar::baz relative the crate root.
Eqlog modules can be annotated with a visibility, or with attributes:
eqlog_mod!(#[cfg(test)] pub baz, "/bar/baz.rs")