pub trait Neu<T: ?Sized> {
// Required method
fn is_match(&self, other: &T) -> bool;
}Required Methods§
Trait Implementations§
Implementations on Foreign Types§
source§impl<'a, T: 'a + ?Sized + PartialOrd + MayDebug> Neu<T> for (Bound<&'a T>, Bound<&'a T>)
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§impl<T: PartialOrd + MayDebug> Neu<T> for Range<&T>
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeToInclusive<&T>
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§impl<T: PartialOrd + MayDebug> Neu<T> for (Bound<T>, Bound<T>)
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeFrom<T>
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeTo<T>
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§impl<T: PartialOrd + MayDebug> Neu<T> for Range<T>
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§impl<const N: usize, T: PartialEq + MayDebug> Neu<T> for [T; N]
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§impl<T: PartialEq + MayDebug> Neu<T> for Vec<T>
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeFrom<&T>
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§impl<'a, T: PartialEq + MayDebug> Neu<T> for &'a [T]
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeInclusive<&T>
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeInclusive<T>
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§impl<T: ?Sized + PartialOrd + MayDebug> Neu<T> for RangeFull
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeToInclusive<T>
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§impl<T: PartialOrd + MayDebug> Neu<T> for RangeTo<&T>
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(())