mail-send icon indicating copy to clipboard operation
mail-send copied to clipboard

Non-async support?

Open mripard opened this issue 3 years ago • 4 comments

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?

mripard avatar Jun 02 '22 08:06 mripard

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.

mdecimus avatar Jun 02 '22 09:06 mdecimus

awesome, thanks :)

mripard avatar Jun 03 '22 13:06 mripard

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.

spikecodes avatar Jun 04 '22 00:06 spikecodes

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

mdecimus avatar Jun 04 '22 11:06 mdecimus