duesee / duesee/smtp-codec

Adding a `Response::from_bytes()` API

Open
#10 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
7
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.