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 {
127
127
128
128
<br >
129
129
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
+
130
138
## Elided lifetimes
131
139
132
140
Be aware that async fn syntax does not allow lifetime elision outside of ` & ` and
Original file line number Diff line number Diff line change 137
137
//!
138
138
//! <br><br>
139
139
//!
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
+ //!
140
149
//! # Elided lifetimes
141
150
//!
142
151
//! 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