File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1- ![ Maintenance] ( https://img.shields.io/badge/maintenance-activly--developed-brightgreen.svg )
2-
31# maybe-async
42
53** Why bother writing similar code twice for blocking and async code?**
@@ -294,5 +292,3 @@ gate when we add `maybe-async` to dependency.
294292
295293## License
296294MIT
297-
298- License: MIT
Original file line number Diff line number Diff line change 1+ # { {crate} }
2+
3+ { {readme} }
Original file line number Diff line number Diff line change 9595//!
9696//! AFIT is acronym for **a**sync **f**unction **i**n **t**rait, stabilized from rust 1.74
9797//!
98+ //! For compatibility reasons, the `async fn` in traits is supported via a verbose `AFIT` flag. This will become
99+ //! the default mode for next major release.
100+ //!
98101//! - `must_be_async`
99102//!
100103//! **Keep async**.
177180//! gate set or not.
178181//!
179182//! ```rust
180- //! #[maybe_async::maybe_async(?Send )]
183+ //! #[maybe_async::maybe_async(AFIT )]
181184//! trait A {
182185//! async fn async_fn_name() -> Result<(), ()> {
183186//! Ok(())
189192//!
190193//! struct Foo;
191194//!
192- //! #[maybe_async::maybe_async(?Send )]
195+ //! #[maybe_async::maybe_async(AFIT )]
193196//! impl A for Foo {
194197//! async fn async_fn_name() -> Result<(), ()> {
195198//! Ok(())
213216//!
214217//! ```rust
215218//! // Compiled code when `is_sync` is toggled off.
216- //! #[async_trait::async_trait(?Send)]
217219//! trait A {
218220//! async fn maybe_async_fn_name() -> Result<(), ()> {
219221//! Ok(())
225227//!
226228//! struct Foo;
227229//!
228- //! #[async_trait::async_trait(?Send)]
229230//! impl A for Foo {
230231//! async fn maybe_async_fn_name() -> Result<(), ()> {
231232//! Ok(())
You can’t perform that action at this time.
0 commit comments