You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/3437-implementable-trait-alias.md
+34-26Lines changed: 34 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,15 +34,16 @@ pub trait Frob {
34
34
}
35
35
```
36
36
37
-
Most of `frob-lib`'s users will need `Frob::frob`'s return type to be `Send`,
38
-
so the library wants to make this common case as painless as possible. But
37
+
Most of `frob-lib`'s users will need `Frob::frob`'s return type to be `Send`, so
38
+
the library wants to make this common case as painless as possible. But
39
39
non-`Send` usage should be supported as well.
40
40
41
41
### MVP: `trait_variant`
42
42
43
43
Because Return Type Notation isn't supported yet, `frob-lib` follows the
44
-
recommended practice of using the [`trait-variant`](https://docs.rs/trait-variant/)
45
-
crate to have `Send` and non-`Send` variants.
44
+
recommended practice of using the
45
+
[`trait-variant`](https://docs.rs/trait-variant/) crate to have `Send` and
46
+
non-`Send` variants.
46
47
47
48
```rust
48
49
//! crate `frob-lib``
@@ -209,7 +210,8 @@ in existence.
209
210
## (Speculative) `Async` trait
210
211
211
212
There has been some discussion about a variant of the `Future` trait with an
212
-
`unsafe` poll method, to support structured concurrency ([wg-async design notes](https://rust-lang.github.io/wg-async/vision/roadmap/scopes/capability/variant_async_trait.html)).
213
+
`unsafe` poll method, to support structured concurrency ([wg-async design
In the context of the above example, a `T: ResultIterator` bound would mean
675
-
"there exist unique types `Ok` and `Err` such that
676
-
`T: Iterator<Item = Result<Ok, Err>>` holds". Current Rust provides no mechanism
677
-
for expressing a bound like that; you need a separate trait, like [`TryFuture`](https://docs.rs/futures-core/latest/futures_core/future/trait.TryFuture.html).
682
+
"there exist unique types `Ok` and `Err` such that `T: Iterator<Item =
683
+
Result<Ok, Err>>` holds". Current Rust provides no mechanism for expressing a
0 commit comments