This commit is contained in:
aozhiwei 2021-12-16 19:55:17 +08:00
parent 06f9371a72
commit 35c51e6acd
2 changed files with 40 additions and 5 deletions

43
server/notifyserver/src/main.rs Normal file → Executable file
View File

@ -1,13 +1,48 @@
use std::rc::Rc;
use r9;
mod test;
mod mt;
pub enum MessagesUnion
{
XValue(Rc::<XValue>),
f2(mt::TxKeyConf)
}
type XValue = r9::XValue::<test::App>;
type MetaMgr = r9::MetaMgr::<MessagesUnion>;
macro_rules! getMeta {
($metamgr:expr, $ty:ident, $idx:expr) => {
//if let Some(v) = $metamgr.get_byid(0, $idx) {
if 1 > 1 {
/*if let MessagesUnion::$ty(v1) = &(**v) {
//Option::<&Rc::<$ty>>::Some(v1);
Option::<&Rc::<$ty>>::None;
} else {
Option::<&Rc::<$ty>>::None;
}*/
Option::<&Rc::<$ty>>::None;
} else {
Option::<&Rc::<$ty>>::None;
}
//Option::<&Rc::<$ty>>::None;
}
}
fn main() {
let mut a = XValue::new();
a.set_i64(2000);
test::hello(&a);
// println!("Hello, world!{}", a.get_i64());
let mut metamgr = MetaMgr::new();
//let b = getMeta!(metamgr, XValue, 0);
let b: Option::<&Rc::<XValue>> = getMeta!(metamgr, XValue, 0);
/*match b {
Some(v) => {
v.get_i64();
}
None => {
}
}*/
}

2
third_party/r9 vendored

@ -1 +1 @@
Subproject commit 1d17503122c192d2135cb9be60eeacd7750c8768
Subproject commit 374a63d8e08659c1b9ba457421450c24fe3cf3c0