#clone

macro extends-rs

rust extends impl a macro attr

3 releases

0.1.6 Jan 22, 2022
0.1.5 Jan 20, 2022

#1635 in Procedural macros

Custom license

32KB
737 lines

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());

 }

Dependencies

~3.5MB
~77K SLoC