I think a simple FromStr-esque trait would be useful to have for organization and possibly some combinators. I use FromStr a lot since its very good for small composable types providing their parsers, and a nom-ified trait for this would be a nice addition.
pub trait Parsable<O>: Sized {
type Err;
fn parse(s: O) -> IResult<Self, O, Self::Err>;
}
I think a simple
FromStr
-esque trait would be useful to have for organization and possibly some combinators. I useFromStr
a lot since its very good for small composable types providing their parsers, and a nom-ified trait for this would be a nice addition.