trait Service {
type Future: Future<...>;
fn process_request(&mut self) -> Self::Future
}
impl Service for MyType {
type Future = impl Future;
fn process_request(&mut self) -> Self::Future { async move { .. } }
trait Foo {
fn foo<T>(x: impl FnOnce() -> T);
self.foo::<u32> // error today, but it would be nice to support it
Rust 2020 Roadmap Goal:
My hope for this meeting
Ergonomics initiative and other “unfinished business” from Rust 2018
impl Trait
trait Service {
type Future: Future<...>;
fn process_request(&mut self) -> Self::Future
}
impl Service for MyType {
type Future = impl Future;
fn process_request(&mut self) -> Self::Future { async move { .. } }
}
trait Foo {
fn foo<T>(x: impl FnOnce() -> T);
}
self.foo::<u32> // error today, but it would be nice to support it
Implicit mod submodule