Created
January 11, 2020 15:49
-
-
Save rust-play/ab9d3bbab87182aaad34fd1069e69471 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Comented code work with nightly | |
//#![feature(type_alias_impl_trait)] | |
trait InterfaceThing { | |
type Result: 'static; | |
fn do_work() -> Self::Result; | |
} | |
struct Z{} | |
impl InterfaceThing for Z { | |
// type Result = impl std::future::Future; | |
type Result = Box<dyn std::future::Future<Output = u8>>; | |
fn do_work() -> Self::Result { | |
// async {5} | |
Box::new(async {5}) | |
} | |
} | |
fn main() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment