File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,14 @@ impl Advertisement for AutoplayingVideo {
127127
128128<br >
129129
130+ ## Non-threadsafe futures
131+
132+ Not all async traits need futures that are ` dyn Future + Send ` . To avoid having
133+ Send and Sync bounds placed on the async trait methods, invoke the async trait
134+ macro as ` #[async_trait(?Send)] ` on both the trait and the impl blocks.
135+
136+ <br >
137+
130138## Elided lifetimes
131139
132140Be aware that async fn syntax does not allow lifetime elision outside of ` & ` and
Original file line number Diff line number Diff line change 137137//!
138138//! <br><br>
139139//!
140+ //! # Non-threadsafe futures
141+ //!
142+ //! Not all async traits need futures that are `dyn Future + Send`. To avoid
143+ //! having Send and Sync bounds placed on the async trait methods, invoke the
144+ //! async trait macro as `#[async_trait(?Send)]` on both the trait and the impl
145+ //! blocks.
146+ //!
147+ //! <br>
148+ //!
140149//! # Elided lifetimes
141150//!
142151//! Be aware that async fn syntax does not allow lifetime elision outside of `&`
You can’t perform that action at this time.
0 commit comments