Crate phf_macros[−][src]
Compiler plugin defining macros that create PHF data structures.
Example
#![feature(plugin, core)] #![plugin(phf_macros)] extern crate phf; #[derive(Clone)] pub enum Keyword { Loop, Continue, Break, Fn, Extern, } static KEYWORDS: phf::Map<&'static str, Keyword> = phf_map! { "loop" => Keyword::Loop, "continue" => Keyword::Continue, "break" => Keyword::Break, "fn" => Keyword::Fn, "extern" => Keyword::Extern, }; pub fn parse_keyword(keyword: &str) -> Option<Keyword> { KEYWORDS.get(keyword).cloned() }
Modules
util |
Macros
phf_map |
Constructs a |
phf_ordered_map |
Constructs a |
phf_ordered_set |
Constructs a |
phf_set |
Constructs a |