syntacks 0.1.0-alpha0.2

An opinionated parser library for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::future::Future;

use crate::{Error, Output, Source, SourceSpan};

pub trait Input<'src>: Sized + Clone + 'src {
	type Source: Source<'src>;
	type Item;

	fn source_span(&self) -> SourceSpan<'src, Self::Source>;
	fn next(self) -> Result<Output<'src, Self, Self::Item>, Error<'src, Self::Source>>;
	fn next_async(self) -> impl Future<Output = Result<Output<'src, Self, Self::Item>, Error<'src, Self::Source>>>;
}