pattern_guard

Macro pattern_guard 

Source
macro_rules! pattern_guard {
    (numeric_range, $min:expr, $max:expr) => { ... };
    (array_shape, $expected_shape:expr) => { ... };
    (string_enum, $valid_options:expr) => { ... };
    ($pattern_name:literal, $guard:expr, $error_msg:literal) => { ... };
    ($pattern_name:literal, $guard_fn:expr, $destructure_fn:expr) => { ... };
}
Expand description

Macro for creating pattern guards with custom validation logic