macro_rules! method {
($name:ident( $i:ty ) -> $o:ty, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$i:ty,$o:ty,$e:ty>, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$i:ty,$o:ty>, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$o:ty>, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident( $i:ty ) -> $o:ty, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$i:ty,$o:ty,$e:ty>, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$i:ty,$o:ty>, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$o:ty>, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident, &$self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident( $i:ty ) -> $o:ty, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$i:ty,$o:ty,$e:ty>, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$i:ty,$o:ty>, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident<$o:ty>, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
($name:ident, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident( $i:ty ) -> $o:ty, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$i:ty,$o:ty,$e:ty>, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$i:ty,$o:ty>, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident<$o:ty>, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
(pub $name:ident, &mut $self_:ident, $submac:ident!( $($args:tt)* )) => { ... };
}
Expand description
Makes a method from a parser combination
The must be set up because the compiler needs the information
ⓘ
method!(my_function<Parser<'a> >( &[u8] ) -> &[u8], tag!("abcd"));
// first type parameter is `self`'s type, second is input, third is output
method!(my_function<Parser<'a>, &[u8], &[u8]>, tag!("abcd"));
//prefix them with 'pub' to make the methods public
method!(pub my_function<Parser<'a>,&[u8], &[u8]>, tag!("abcd"));