noa_parser/matcher.rs
1/// Describes a matchable object.
2pub trait Match<T> {
3 /// Returns true if the data matches the pattern.
4 ///
5 /// # Arguments
6 /// data - the data to match
7 ///
8 /// # Returns
9 /// (true, index) if the data matches the pattern,
10 /// (false, index) otherwise
11 fn matcher(&self, data: &[T]) -> (bool, usize);
12}
13
14pub trait MatchSize {
15 /// Returns the size of the matchable object.
16 fn size(&self) -> usize;
17}