Macro nom::named [−][src]
Makes a function from a parser combination
The type can be set up if the compiler needs more information
Function-like declaration:
named!(my_function( &[u8] ) -> &[u8], tag!("abcd"));
Alternative declaration. First type parameter is input, second is output:
named!(my_function<&[u8], &[u8]>, tag!("abcd"));
This one will have &[u8]
as input type, &[u8]
as output type:
named!(my_function, tag!("abcd"));
Will use &[u8]
as output type:
named!(my_function<&[u8]>, tag!("abcd"));
Prefix them with ‘pub’ to make the functions public:
named!(pub my_function, tag!("abcd"));
Prefix them with ‘pub(crate)’ to make the functions public within the crate:
named!(pub(crate) my_function, tag!("abcd"));