23 lines
413 B
Rust
23 lines
413 B
Rust
use std::future::Future;
|
|
use std::pin::Pin;
|
|
use std::task::{Context, Poll};
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
invoke().await
|
|
}
|
|
|
|
struct FutureImpl {}
|
|
|
|
impl Future for FutureImpl {
|
|
type Output = ();
|
|
|
|
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
|
|
println!("Hello World!");
|
|
Poll::Ready(())
|
|
}
|
|
}
|
|
|
|
fn invoke() -> impl Future<Output=()> {
|
|
FutureImpl {}
|
|
} |