Skip to content

FromStr-esque parsing trait #1724

@JamieH01

Description

@JamieH01

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>; 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions