extends-rs

Crates.ioextends-rs
lib.rsextends-rs
version0.1.6
sourcesrc
created_at2022-01-12 04:38:45.542553
updated_at2022-01-22 08:33:26.512988
descriptionrust extends impl a macro attr
homepage
repository
max_upload_size
id512580
size32,503
(450220020)

documentation

https://docs.rs/extends-rs

README

extends-rs

rust extends struct

//extends=rsdata::dbs::arbatis::base_struct::BaseDO@struct      注意BaseDO 与struct中间有个阿尔法符号 用来标记继承那种类型的内容
//同级crate 中 rsdata/src/dbs/arbatis/base_struct.rs   struct BaseDO
//如果不存在向上一级寻找  仅1次 
 #[extends_struct(derive="Debug,Clone"&&extends="rsdata::dbs::arbatis::base_struct::BaseDO@struct")]
 struct bbc {
     pub a: Option<i8>,
 }

 #[test]
 fn showa() {
     println!("{:#?}", bbc::new_none());
     let mut a = bbc::new_none();
     a.result = Some(false);
     println!("{:#?}", a);
     println!("aaffff:{:?}", bbc::get_struct_attr_str());

 }
Commit count: 0

cargo fmt