Skip to main content

option_message

Macro option_message 

Source
macro_rules! option_message {
    ($($key:expr => $val:expr),* $(,)?) => { ... };
    ($msg:expr) => { ... };
}
Expand description

This macro can be used to create an object-like protobuf option. It follows the syntax of crates like maplit, for creating key-value pairs.

ยงExamples

use protify::*;

let option = option_message!("is_cool" => true);
let value = option.get("is_cool").unwrap();

assert_eq!(value, &OptionValue::Bool(true));