pub fn convert<U, E, F>(self, f: F) -> Parser<'a, I, U>
	where
		F: Fn(O) -> ::std::result::Result<U, E> + 'a,
		E: Debug,
		O: 'a,
		U: 'a,
	{
		Parser::new(move |input: &'a [I], start: usize| {
			(self.method)(input, start).and_then(|(res, pos)| match f(res) {
				Ok(out) => Ok((out, pos)),
				Err(err) => Err(Error::Conversion {
					message: format!("Conversion error: {:?}", err),
					position: start,
				}),
			})
		})
	}
/// Convert parser result to desired value, fail in case of conversion error.
Convert parser result to desired value, fail in case of conversion error.
Convert parser result to desired value fail in case of conversion error .
pub fn convert<U, E, F>(self, f: F) -> Parser<'a, I, U>
	where
		F: Fn(O) -> ::std::result::Result<U, E> + 'a,
		E: Debug,
		O: 'a,
		U: 'a,
	{
		Parser::new(move |input: &'a [I], start: usize| {
			(self.method)(input, start).and_then(|(res, pos)| match f(res) {
				Ok(out) => Ok((out, pos)),
				Err(err) => Err(Error::Conversion {
					message: format!("Conversion error: {:?}", err),
					position: start,
				}),
			})
		})
	}
pub fn convert < U , E , F > ( self , f : F ) -> Parser < ' a , I , U > where F : Fn ( O ) -> :: std :: result :: Result < U , E > + ' a , E : Debug , O : ' a , U : ' a , { Parser :: new ( move | input : & ' a [ I ] , start : usize | { ( self . method ) ( input , start ) . and_then ( | ( res , pos ) | match f ( res ) { Ok ( out ) => Ok ( ( out , pos ) ) , Err ( err ) => Err ( Error :: Conversion { message : format ! ( " " err ) , position : start , } ) , } ) } ) }
Convert parser result to desired value, fail in case of conversion error.
Convert parser result to desired value fail in case of conversion error .
self
f
F