iocmap

Crates.ioiocmap
lib.rsiocmap
version0.1.2
sourcesrc
created_at2022-01-24 02:28:03.09065
updated_at2022-01-24 09:54:38.522995
descriptionrust ioc macro
homepage
repository
max_upload_size
id519965
size7,618
(450220020)

documentation

https://docs.rs/iocmap

README

ioc

rust new ioc

#[autowired] static defsingle: Option = None;

// 展开 // macro_rules! defsingle { // () => { // single_get!( "defsingle", EntityObj) // }; // } //这里是注入,后面还需要撸全局扫描注册组件,写法应该几乎一致,同样可用的内容还有这几个crate singlemap,iocmap,aop,extends-rs

#[test] fn test_one() { single_add!( "defsingle", Box::new(EntityObj { key: "hhhhh".to_string() }) ); println!("注入后获取值 :{:?}", defsingle!().key); }

Commit count: 0

cargo fmt