Skip to content

Adding a Response::from_bytes() API #10

@djc

Description

@djc

I think this would be better API than providing raw nom parsers. I tried to implement it but ran into some snags which I briefly mentioned on Discord. Capturing here because it's probably a better venue:

If we implement a generic Response::from_bytes() API I don't think we can easily keep the Greeting and Ehlo variants
because those are really just more specific cases of Reply_lines/Other. I would be inclined to simplify Response to just be what Response::Other is now, it could provide as_greeting() and as_ehlo() methods instead that handle further parsing? The question here is if the connection state is allowed to influence parsing; IMO it's better to keep these separate where possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions