macro_rules! def_resource {
    ( $( $(#[$attr:meta])* $vis:vis static $name:ident: $ty:ty = $default:expr; )+ ) => { ... };
}Expand description
Defines a resource that managed by AxNamespace.
Each resource will be collected into the axns_resource section. When
accessed, it is either dereferenced from the global namespace or the
thread-local namespace according to the thread-local feature.
ยงExample
use axns::ResArc;
axns::def_resource! {
    static FOO: u32 = 42;
    static BAR: ResArc<String> = ResArc::new();
}
BAR.init_new("hello world".to_string());
assert_eq!(*FOO, 42);
assert_eq!(BAR.as_str(), "hello world");
mod imp {
    use axns::{AxNamespace, AxNamespaceIf};
    struct ResArcImpl;
    #[crate_interface::impl_interface]
    impl AxNamespaceIf for ResArcImpl {
        fn current_namespace_base() -> *mut u8 {
            AxNamespace::global().base()
        }
    }
}