3 releases (breaking)
0.3.0 | Nov 22, 2021 |
---|---|
0.2.0 | Sep 15, 2020 |
0.1.0 | Jul 29, 2020 |
#1054 in Procedural macros
68,355 downloads per month
Used in 982 crates
(via ndk-glue)
28KB
703 lines
ndk-macro
Implementation of the attribute procedural macro main
which applied directly to main function.
This macro is re-exported in ndk-glue
. Typically, it's not needed to depend on this library directly!
Usage
#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))]
pub fn main() {
println!("hello world");
}
The attribute macro supports optional input attributes:
backtrace = "on|full"
: Enables backtraces by setting theRUST_BACKTRACE
env varndk_glue = "path::to::ndk_glue"
: Overrides default path to ndk_glue cratelogger(...props)
: Configures android logger with the passed configuration (requires thelogger
feature):level = "error|warn|info|debug|trace"
: Changes log level for loggertag = "my-tag"
: Assigns tag to loggerfilter = "filtering-rules"
: Changes default filtering rules
Dependencies
~4MB
~85K SLoC