-
Notifications
You must be signed in to change notification settings - Fork 273
README use of FutureResult is out of date #596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm using the latest released version which appears to be |
@jbaublitz This code uses
|
This is no longer an issue for me. Closing. |
Resolves paritytech#596 This grabs the example server implementation from [the root README](https://github.com/paritytech/jsonrpc#basic-usage-with-http-transport), as the given example ([rendered in docs.rs](https://paritytech.github.io/jsonrpc/jsonrpc_http_server/index.html)) currently fails with the following: ``` error[E0277]: `Result<jsonrpc_http_server::jsonrpc_core::Value, _>` is not a future --> src/main.rs:6:5 | 6 | io.add_method("say_hello", |_| { | ^^^^^^^^^^ `Result<jsonrpc_http_server::jsonrpc_core::Value, _>` is not a future | = help: the trait `std::future::Future` is not implemented for `Result<jsonrpc_http_server::jsonrpc_core::Value, _>` = note: required because of the requirements on the impl of `RpcMethodSimple` for `[closure@src/main.rs:6:29: 8:3]` ```
) Resolves #596 This grabs the example server implementation from [the root README](https://github.com/paritytech/jsonrpc#basic-usage-with-http-transport), as the given example ([rendered in docs.rs](https://paritytech.github.io/jsonrpc/jsonrpc_http_server/index.html)) currently fails with the following: ``` error[E0277]: `Result<jsonrpc_http_server::jsonrpc_core::Value, _>` is not a future --> src/main.rs:6:5 | 6 | io.add_method("say_hello", |_| { | ^^^^^^^^^^ `Result<jsonrpc_http_server::jsonrpc_core::Value, _>` is not a future | = help: the trait `std::future::Future` is not implemented for `Result<jsonrpc_http_server::jsonrpc_core::Value, _>` = note: required because of the requirements on the impl of `RpcMethodSimple` for `[closure@src/main.rs:6:29: 8:3]` ```
I tried using
FutureResult
as specified in the README when trying to prototype a derived interface, but thejsonrpc_core::Error
type cannot be used inFutureResult
as suggested by the README. I've dug into the code a little bit more and it appears that it is expecting the second type parameter toFutureResult
to be aFuture
whichjsonrpc_core::Error
is not. Would you be able to update the README or provide a suggestion for how to work around this?The text was updated successfully, but these errors were encountered: