scan_rules::scan!
[−]
[src]
macro_rules! scan { ($input:expr; ($($head_pattern:tt)*) => $head_body:expr $(, ($($tail_patterns:tt)*) => $tail_bodies:expr)* $(,)* ) => { ... }; }
Scans the provided input, using the specified rules. The result is a Result<T, ScanError>
where T
is the type of the rule bodies; just as with match
, all bodies must agree on their result type.
The input may be any value which implements Into<Cursor>
, which includes &str
.
See also: Pattern Syntax.