pub trait RpcMethod {
type Params: Serialize + DeserializeOwned + JsonSchema;
type Result: Serialize + DeserializeOwned + JsonSchema;
const NAME: &'static str;
const SUMMARY: &'static str;
const TAGS: &'static [&'static str] = _;
const DEPRECATED: Option<&'static str> = None;
// Provided methods
fn param_schema() -> Schema { ... }
fn result_schema() -> Schema { ... }
}Expand description
Represents a JSON-RPC method with typed params and result.
Required Associated Constants§
Provided Associated Constants§
Sourceconst DEPRECATED: Option<&'static str> = None
const DEPRECATED: Option<&'static str> = None
Optional deprecation message.
Required Associated Types§
Sourcetype Params: Serialize + DeserializeOwned + JsonSchema
type Params: Serialize + DeserializeOwned + JsonSchema
JSON-serializable params type.
Sourcetype Result: Serialize + DeserializeOwned + JsonSchema
type Result: Serialize + DeserializeOwned + JsonSchema
JSON-serializable result type.
Provided Methods§
Sourcefn param_schema() -> Schema
fn param_schema() -> Schema
Generate JSON Schema for parameters.
Sourcefn result_schema() -> Schema
fn result_schema() -> Schema
Generate JSON Schema for result.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".