[−][src]Macro sealrs::cast
Casts some Message to the specified type and call user function with this value. Macro may be used as extractor of data from a messages, because he may return values from itself based on the data from a message
Example
// As validator cast!(msg, responses::MsgResponse, m => { assert_eq!(m.data, 99); }); // As extractor let data = cast!(msg, responses::MsgResponse, m => { m.data; });
Panic
Macro will case panic, if downcast operation will be failed.