[][src]Macro nom5_locate::impl_compare

macro_rules! impl_compare {
    ( $fragment_type:ty, $compare_to_type:ty ) => { ... };
}

Implement nom::Compare for a specific fragment type.

Parameters

  • $fragment_type - The LocatedSpan's fragment type
  • $compare_to_type - The type to be comparable to LocatedSpan<$fragment_type>

Example of use

NB: This example is an extract from the nom_locate source code.

This example is not tested
#[macro_use]
extern crate nom_locate;
impl_compare!(&'b str, &'a str);
impl_compare!(&'b [u8], &'a [u8]);
impl_compare!(&'b [u8], &'a str);