-
I have a PropMap ( Setup code: // This is one of the PropMaps in the inner array
let mut inner_prop_map = PropMap::new();
inner_prop_map.insert("foobar".into(), Variant(Box::new(123)));
let prop_map_array = vec![inner_prop_map];
let mut prop_map = PropMap::new();
prop_map.insert("foo".into(), Variant(Box::new(prop_map_array))); Doing the prop cast on assert!(cast::<Vec<PropMap>>(prop_map.get("foo").unwrap()).is_some()); But when I send it into a let msg = Message::new_method_call("a.b.c", "/a/b/c", "a.b.c", "AaBb").unwrap().append1(prop_map);
let another_map = msg.get1::<PropMap>().unwrap();
assert!(cast::<Vec<PropMap>>(another_map.get("foo").unwrap().is_none()); The only thing that works is using (I want to be able to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@grimsteel I'm afraid I can not explain the behavior you've observed. I did notice that the last line of your last example:
is missing a closing paren. |
Beta Was this translation helpful? Give feedback.
Signatures that start with
aa
cannot be downcasted to, as they don't have a stable RefArg type.This is kind of implied by the argument guide 's reference section, but the docs could be clearer.