stalwartlabs / mail-send

E-mail delivery library for Rust with DKIM support
https://docs.rs/mail-send/
Apache License 2.0
202 stars 21 forks source link

Non-async support? #3

Open mripard opened 2 years ago

mripard commented 2 years ago

Hi,

Thanks for publishing this crate and all the other, related, ones.

I'd like to use it in a small program that wouldn't use async or tokio, and it's not clear to me whether it can be done.

The doc says:

Full async (requires Tokio).

which is a bit ambiguous to me. Does it support async with a dependency on tokio if it is enabled, or is the crate only designed to support async?

If the latter, do you have any plans on supporting non-async?

mdecimus commented 2 years ago

Hi, At the moment the library only supports async using Tokio, there is no support for other runtimes or blocking. However, non-async should be fairly easy to implement (just two functions need to be changed) so as soon as I have some time I'll do it.

mripard commented 2 years ago

awesome, thanks :)

spikecodes commented 2 years ago

maybe-async-rs is a fantastic crate that could definitely help with this. It is a selection of procedural macros that easily allow crate developers to make their code both compatible for async (it supports using tokio and async-std as the backends) and sync through the use of a crate feature.

mdecimus commented 2 years ago

@spikecodes Thanks, I'll have a look at it next week.