How should I implement await for struct

This is the error log:

`Summer` is not a future
the trait `Future` is not implemented for `Summer`
Summer must be a future or must implement `IntoFuture` to be awaited
required because of the requirements on the impl of `IntoFuture` for `Summer`rustcE0277
main.rs(11, 11): remove the `.await`
pub struct Summer {
    listener: TcpListener,
}

impl IntoFuture for AddrIncoming {
    type Output;

    type Future;

    fn into_future(self) -> Self::Future {
        todo!()
    }
}

I implemented IntoFuture for struct according to the error log, but I don't know what to do next

I am making a web demo, I have seen hyper and actix-web, and they are very useful

Don't implement IntoFuture, implement Future. IntoFuture is an unstable trait that may get removed.

1 Like

yep, I see this issue

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.