Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Rust JSONRPC Client
Rudimentary support for sending JSONRPC 2.0 requests and receiving responses.
Serde Support
This includes a of macro to enable serialization/deserialization of structures without using stable or nightly. They can be used as follows:
extern crate jsonrpc;
extern crate serde;
serde_struct_impl!;
There is also a variant of this for enums representing structures that might have one of a few possible forms. For example
struct Variant1 {
success: bool,
success_message: String
}
struct Variant2 {
success: bool,
errors: Vec<String>
}
enum Reply {
Good(Variant1),
Bad(Variant2)
}
serde_struct_enum_impl!(Reply, reply_mod,
Variant1, success, success_message;
Variant2, success, errors
);
Here reply_mod
just needs to be something unique. It is a limitation of the
macro system (specifically, I cannot gensym a module) that this has to be
there. Suggestions for how to remove this wart on the interface are welcome.
Note that this macro works by returning the first variant for which all fields are present. This means that if one variant is a superset of another, the larger one should be given first to the macro to prevent the smaller from always being matched.
JSONRPC
To send a request which should retrieve the above structure, consider the following example code
extern crate jsonrpc;
extern crate serde;
serde_struct_deserialize!;