I am developing a project using crate iced, and the application trait require a method implemented with the following signature:
fn new(_flags: ()) -> (Memories, Command<Message>) {}
However, I tried to add an async function in the required method and the compiler made an argument of unable to complete the type conversion between impl std::future::Future<Output = Result<Value, _>>
(which the async function returns) and Value
(which I need it for the return value of new()
).
Here is the build info:
PS C:\graduate> cargo build
Compiling graduate v0.1.0 (C:\graduate)
error[E0308]: mismatched types
--> src\main.rs:113:27
|
113 | idxtable: exchange::getidx(cli, format!("{}{}", url_prefix, "index.toml"), idxdir),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Value`, found opaque type
|
note: while checking the return type of the `async fn`
--> src\exchange.rs:10:66
|
10 | pub async fn getidx<E>(cli: Client, url: String, dir: String) -> Result<Value, E> {
| ^^^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected enum `Value`
found opaque type `impl std::future::Future<Output = Result<Value, _>>`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `graduate` due to previous error
This is my first time opening a topic, so please let me know if there is anything to add or explain.