use nom::branch::alt; use nom::error::VerboseError; use nom::IResult; #[derive(Clone)] pub struct NomContext // where // F: for<'a> FnMut(&'a str) -> IResult<&'a str, &'a str, VerboseError<&'a str>>, // F: Clone, { // pub fail_matcher: F, /// You can't have nested bolds in org-mode pub can_match_bold: bool, pub can_match_link: bool, } impl NomContext { pub fn new(fail_matcher: F) -> Self { NomContext { // fail_matcher, can_match_bold: true, can_match_link: true, } } }