macro_rules! gsw {
($($name:ident: &$T:ty),* $(,)?) => { ... };
($($name:ident: $T:ty),* $(,)?) => { ... };
(@get $name:ident: &$T:ty) => { ... };
(@get $name:ident: $(&)?$T:ty) => { ... };
(@set $($name:ident: $T:ty),*) => { ... };
(@set_impl $name:ident: $T:ty) => { ... };
}Expand description
generates methods for some type or type reference
ยงExamples
use scsys_core::gsw;
#[derive(Debug, Clone)]
struct MyStruct<T> {
a: u32,
b: u32,
c: T,
}
impl<T> MyStruct<T> {
gsw! {
a: u32,
b: u32,
}
gsw! {
c: &T,
}
}