macro_rules! named {
(#$($args:tt)*) => { ... };
($name:ident( $i:ty ) -> $o:ty, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$i:ty,$o:ty,$e:ty>, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$i:ty,$o:ty>, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$o:ty>, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident( $i:ty ) -> $o:ty, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$i:ty,$o:ty,$e:ty>, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$i:ty,$o:ty>, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$o:ty>, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub(crate) $name:ident( $i:ty ) -> $o:ty, $submac:ident!( $($args:tt)* )) => { ... };
(pub(crate) $name:ident<$i:ty,$o:ty,$e:ty>, $submac:ident!( $($args:tt)* )) => { ... };
(pub(crate) $name:ident<$i:ty,$o:ty>, $submac:ident!( $($args:tt)* )) => { ... };
(pub(crate) $name:ident<$o:ty>, $submac:ident!( $($args:tt)* )) => { ... };
(pub(crate) $name:ident, $submac:ident!( $($args:tt)* )) => { ... };
}
Makes a function from a parser combination
The type can be set up if the compiler needs
more information
named!(my_function( &[u8] ) -> &[u8], tag!("abcd"));
named!(my_function<&[u8], &[u8]>, tag!("abcd"));
named!(my_function, tag!("abcd"));
named!(my_function<&[u8]>, tag!("abcd"));
named!(pub my_function, tag!("abcd"));
named!(pub(crate) my_function, tag!("abcd"));