Macro gluon_vm::record_p

source ·
macro_rules! record_p {
    ($($field: pat),* $(,)?) => { ... };
}
Expand description

Creates a pattern which matches on marshalled gluon records

#[macro_use]
extern crate gluon_vm;
fn main() {
    match record!(x => 1, y => "y") {
        record_p!(a, "y") => assert_eq!(a, 1),
        _ => assert!(false),
    }
}