1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16

use std::any::Any;
use std::ops::Range;
use crate::*;
use std::fmt::Debug;

/// Implements how a `Parser` should consume its input to yield `Self::Target`.
pub trait Expect : Debug + Clone + Any + 'static {

	/// The type expected from parsing `Self`.
	type Target;

	/// What a parser will call to advance itself. 
	fn expect_from(parser: &mut Parser) -> Result<Self::Target>;	

}