macro_rules! cast {
($ident:path, $expr:expr) => { ... };
}
Expand description
Retrieve leaf value into a type tree
This is a facilitate macro use to visit a type tree and check and retrieve the inner value
ยงExample
let message = component!(
"header" => U32::LE(1234)
);
let header = cast!(DataType::U32, message["header"]).unwrap();
assert_eq!(header, 1234)