Macro frunk::hlist_pat
[−]
macro_rules! hlist_pat { { } => { ... }; { $ head : pat , $ ( $ tail : tt ) , + } => { ... }; { $ head : pat } => { ... }; { $ head : pat , $ ( $ tail : tt , ) + } => { ... }; { $ head : pat , } => { ... }; }
Macro for pattern-matching on HLists.
Taken from https://github.com/tbu-/rust-rfcs/blob/master/text/0873-type-macros.md
Examples
let h = hlist![13.5f32, "hello", Some(41)]; let hlist_pat![h1, h2, h3] = h; assert_eq!(h1, 13.5f32); assert_eq!(h2, "hello"); assert_eq!(h3, Some(41));Run