ndk-macro

Crates.iondk-macro
lib.rsndk-macro
version0.3.0
sourcesrc
created_at2020-07-29 15:18:50.216753
updated_at2021-11-22 15:36:03.605591
descriptionHelper macros for android ndk
homepagehttps://github.com/rust-windowing/android-ndk-rs
repositoryhttps://github.com/rust-windowing/android-ndk-rs
max_upload_size
id270957
size28,345
Publishers (github:rust-windowing:publishers)

documentation

https://docs.rs/ndk-macro

README

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 the RUST_BACKTRACE env var
  • ndk_glue = "path::to::ndk_glue": Overrides default path to ndk_glue crate
  • logger(...props): Configures android logger with the passed configuration (requires the logger feature):
    • level = "error|warn|info|debug|trace": Changes log level for logger
    • tag = "my-tag": Assigns tag to logger
    • filter = "filtering-rules": Changes default filtering rules
Commit count: 313

cargo fmt