Trait scan_rules::scanner::ScanStr
[−]
[src]
pub trait ScanStr<'a>: Sized { type Output; fn scan(&mut self, s: &'a str) -> Result<(Self::Output, usize), ScanErrorKind>; }
This trait defines the interface for runtime scanners.
Runtime scanners must be created before they can be used, but this allows their behaviour to be modified at runtime.
Associated Types
type Output
The type that the implementation scans into.
Required Methods
fn scan(&mut self, s: &'a str) -> Result<(Self::Output, usize), ScanErrorKind>
Perform a scan on the given input.
See: ScanFromStr::scan_from
.
Implementors
impl<'a, Then> ScanStr<'a> for ExactWidth<Then> where Then: ScanStr<'a>
impl<'a, Then> ScanStr<'a> for MaxWidth<Then> where Then: ScanStr<'a>
impl<'a, Then> ScanStr<'a> for MinWidth<Then> where Then: ScanStr<'a>
impl<'a, Then> ScanStr<'a> for ScanRegex<Then> where Then: ScanStr<'a>
impl<'a, S> ScanStr<'a> for ScanA<S> where S: ScanFromStr<'a>