Macro quilkin::map_proto_enum
source · [−]macro_rules! map_proto_enum {
(
value = $value:expr,
field = $field:literal,
proto_enum_type = $proto_enum_type:ty,
target_enum_type = $target_enum_type:ty,
variants = [ $( $variant:tt ),+ ]
) => { ... };
}
Expand description
Maps an integer from a protobuf enum value to a target enum variant.
Both protobuf and target enum must have similar variants.
The protobuf enum variant should be cast-able to an i32
Returns an OK
Result with the target enum variant otherwise ConvertProtoConfigError
if the provided value does not map to any enum variant.