/// If the opening delimiter is present, consumes it, calls the `inner`
/// function, and parses the closing delimiter. Properly recovers to and
/// including the closing delimiter if the `inner` function throws an error.
/// If the opening delimiter is not present, returns `None`.
If the opening delimiter is present, consumes it, calls the `inner`
function, and parses the closing delimiter. Properly recovers to and
including the closing delimiter if the `inner` function throws an error.
If the opening delimiter is not present, returns `None`.
If the opening delimiter is present consumes it calls the ` inner ` function and parses the closing delimiter . Properly recovers to and including the closing delimiter if the ` inner ` function throws an error . If the opening delimiter is not present returns ` None ` .
pub fn try_flanked<P: Parser, R, F>(
    p: &mut P,
    delim: DelimToken,
    inner: F,
) -> RecoveredResult<Option<R>>
where
    F: FnMut(&mut P) -> ReportedResult<R>,
{
    if p.peek(0).value == OpenDelim(delim) {
        flanked(p, delim, inner).map(|r| Some(r))
    } else {
        Ok(None)
    }
}
pub fn try_flanked < P : Parser , R , F > ( p : & mut P , delim : DelimToken , inner : F , ) -> RecoveredResult < Option < R > > where F : FnMut ( & mut P ) -> ReportedResult < R > , { if p . peek ( 0 ) . value == OpenDelim ( delim ) { flanked ( p , delim , inner ) . map ( | r | Some ( r ) ) } else { Ok ( None ) } }
If the opening delimiter is present, consumes it, calls the `inner`
function, and parses the closing delimiter.
If the opening delimiter is present consumes it calls the ` inner ` function and parses the closing delimiter .
p
&mut P
delim
DelimToken
inner
F