Trait neure::neu::Neu

source ·
pub trait Neu<T: ?Sized> {
    // Required method
    fn is_match(&self, other: &T) -> bool;
}

Required Methods§

source

fn is_match(&self, other: &T) -> bool

Trait Implementations§

source§

impl<T> Neu<T> for Box<dyn Neu<T>>

source§

fn is_match(&self, other: &T) -> bool

Implementations on Foreign Types§

source§

impl<'a, T: 'a + ?Sized + PartialOrd + MayDebug> Neu<T> for (Bound<&'a T>, Bound<&'a T>)

Match value in the range.

Example

    let hex = (Bound::Included(&'a'), Bound::Excluded(&'g'));
    let hex = re!((hex){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&hex)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<U, T> Neu<T> for Rc<U>where U: Neu<T>,

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T> Neu<T> for Box<dyn Neu<T>>

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for Range<&T>

Match value in the range.

Example

    let hex = &'a' .. &'g';
    let hex = re!((hex){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&hex)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<U, T> Neu<T> for Cell<U>where U: Neu<T> + Copy,

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeToInclusive<&T>

Match value in the range.

Example

    let to = ..= &'f';
    let to = re!((to){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&to)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for (Bound<T>, Bound<T>)

Match value in the range.

Example

    let hex = (Bound::Included('a'), Bound::Excluded('g'));
    let hex = re!((hex){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&hex)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeFrom<T>

Match value in the range.

Example

    let from = 'a' ..;
    let from = re!((from){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&from)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeTo<T>

Match value in the range.

Example

    let to = .. 'g';
    let to = re!((to){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&to)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for Range<T>

Match value in the range.

Example

    let hex = 'a' .. 'g';
    let hex = re!((hex){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&hex)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<const N: usize, T: PartialEq + MayDebug> Neu<T> for [T; N]

Match any value in the array.

Example

  let arr = ['a', 'c', 'f', 'e'];
  let mut ctx1 = CharsCtx::new("aaffeeeaccc");
  let mut ctx2 = CharsCtx::new("acdde");

  assert_eq!(ctx1.try_mat(&arr.repeat_range(2..6)).unwrap(), Span::new(0, 5));
  assert_eq!(ctx2.try_mat(&arr.repeat_range(2..6)).unwrap(), Span::new(0, 2));
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialEq + MayDebug> Neu<T> for Vec<T>

Match any value in the vector.

Example

    let hex = vec!['a', 'b', 'c', 'd', 'e', 'f'];
    let hex = re!((hex){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&hex)?, Span::new(0, 6));

    let mut ctx = CharsCtx::new("0xbbb");

    assert!(ctx.try_mat(&hex).is_err());

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeFrom<&T>

Match value in the range.

Example

    let from = &'a' ..;
    let from = re!((from){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&from)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<'a, T: PartialEq + MayDebug> Neu<T> for &'a [T]

Match any value in the array.

Example

  let arr = &[b'a', b'c', b'f', b'e'] as &[u8];
  let arr = Neu2Re::repeat_range(arr, 2..6);
  let mut ctx1 = BytesCtx::new(b"aaffeeeaccc");
  let mut ctx2 = BytesCtx::new(b"acdde");

  assert_eq!(ctx1.try_mat(&arr).unwrap(), Span::new(0, 5));
  assert_eq!(ctx2.try_mat(&arr).unwrap(), Span::new(0, 2));
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T> Neu<T> for charwhere T: MayDebug, Self: PartialEq<T>,

source§

fn is_match(&self, other: &T) -> bool

source§

impl<U, T> Neu<T> for RefCell<U>where U: Neu<T>,

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T> Neu<T> for Arc<dyn Neu<T>>

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeInclusive<&T>

Match value in the range.

Example

    let hex = &'a' ..= &'f';
    let hex = re!((hex){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&hex)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeInclusive<T>

Match value in the range.

Example

    let hex = 'a' ..= 'f';
    let hex = re!((hex){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&hex)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<U, T> Neu<T> for Arc<U>where U: Neu<T>,

source§

fn is_match(&self, other: &T) -> bool

source§

impl<U, T> Neu<T> for Mutex<U>where U: Neu<T> + Copy,

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: ?Sized + PartialOrd + MayDebug> Neu<T> for RangeFull

Match value in the range.

Example

    let full = ..;
    let full = re!((full){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&full)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeToInclusive<T>

Match value in the range.

Example

    let to = ..= 'f';
    let to = re!((to){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&to)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

source§

impl<T> Neu<T> for u8where T: MayDebug, Self: PartialEq<T>,

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T> Neu<T> for Rc<dyn Neu<T>>

source§

fn is_match(&self, other: &T) -> bool

source§

impl<T: PartialOrd + MayDebug> Neu<T> for RangeTo<&T>

Match value in the range.

Example

    let to = .. &'g';
    let to = re!((to){1,6});
    let mut ctx = CharsCtx::new("aabbccgg");

    assert_eq!(ctx.try_mat(&to)?, Span::new(0, 6));

    Ok(())
source§

fn is_match(&self, other: &T) -> bool

Implementors§

source§

impl Neu<char> for Alphabetic

source§

impl Neu<char> for Alphanumeric

source§

impl Neu<char> for Ascii

source§

impl Neu<char> for AsciiAlphabetic

source§

impl Neu<char> for AsciiAlphanumeric

source§

impl Neu<char> for AsciiControl

source§

impl Neu<char> for AsciiDigit

source§

impl Neu<char> for AsciiGraphic

source§

impl Neu<char> for AsciiHexDigit

source§

impl Neu<char> for AsciiLowercase

source§

impl Neu<char> for AsciiPunctuation

source§

impl Neu<char> for AsciiUppercase

source§

impl Neu<char> for AsciiWhiteSpace

source§

impl Neu<char> for Control

source§

impl Neu<char> for Digit

source§

impl Neu<char> for Lowercase

source§

impl Neu<char> for Numeric

source§

impl Neu<char> for Uppercase

source§

impl Neu<char> for WhiteSpace

source§

impl Neu<char> for Wild

source§

impl Neu<u8> for Ascii

source§

impl Neu<u8> for AsciiAlphabetic

source§

impl Neu<u8> for AsciiAlphanumeric

source§

impl Neu<u8> for AsciiControl

source§

impl Neu<u8> for AsciiDigit

source§

impl Neu<u8> for AsciiGraphic

source§

impl Neu<u8> for AsciiHexDigit

source§

impl Neu<u8> for AsciiLowercase

source§

impl Neu<u8> for AsciiPunctuation

source§

impl Neu<u8> for AsciiUppercase

source§

impl Neu<u8> for AsciiWhiteSpace

source§

impl<L, R, T> Neu<T> for And<L, R, T>where L: Neu<T>, R: Neu<T>,

source§

impl<L, R, T> Neu<T> for Or<L, R, T>where L: Neu<T>, R: Neu<T>,

source§

impl<T, F> Neu<T> for Fwhere T: MayDebug, F: Fn(&T) -> bool,

source§

impl<T: MayDebug> Neu<T> for False<T>

source§

impl<T: MayDebug> Neu<T> for True<T>

source§

impl<T: PartialEq + MayDebug> Neu<T> for Equal<T>

source§

impl<T: PartialOrd + MayDebug> Neu<T> for CRange<T>

source§

impl<U, I, T> Neu<T> for MayUnit<U, I, T>where U: Neu<T>, I: Neu<T>, T: MayDebug,

source§

impl<U, T> Neu<T> for Not<U, T>where U: Neu<T>,