Macro jsonrpsee_proc_macros::rpc_client_api[][src]

rpc_client_api!() { /* proc-macro */ }

Wraps around one or more API definitions and generates an enum.

The format within this macro must be:

jsonrpsee_proc_macros::rpc_client_api! {
    Foo { ... }
    pub(crate) Bar { ... }
}

The Foo and Bar are identifiers, optionally prefixed with a visibility modifier (e.g. pub).

The content of the blocks is the same as the content of a trait definition, except that default implementations for methods are forbidden.

For each identifier (such as Foo and Bar in the example above), this macro will generate an enum where each variant corresponds to a function of the definition. Function names are turned into PascalCase to conform to the Rust style guide.

Additionally, each generated enum has one method per function definition that lets you perform the method has a client.