Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pattern matching with match and case

rust
#[derive(Oxiplate)]
#[oxiplate = "page.oxip"]
struct YourStruct {
    value: isize,
}
rust
print!("{}", YourStruct {
    value: -19
});
page.oxip
{% match value %}
{%- case ..0 -%}
    Less than zero
{%- case 0 -%}
    Zero
{%- case .. -%}
    Greater than zero
{%- endmatch %}
page.txt
Less than zero