[−][src]Macro nom::named
Makes a function from a parser combination
The type can be set up if the compiler needs more information
ⓘThis example is not tested
named!(my_function( &[u8] ) -> &[u8], tag!("abcd")); // first type parameter is input, second is output named!(my_function<&[u8], &[u8]>, tag!("abcd")); // will have &[u8] as input type, &[u8] as output type named!(my_function, tag!("abcd")); // will use &[u8] as input type (use this if the compiler // complains about lifetime issues named!(my_function<&[u8]>, tag!("abcd")); //prefix them with 'pub' to make the functions public named!(pub my_function, tag!("abcd"));