pub trait JrResponsePayload:
'static
+ Debug
+ Sized
+ Send {
// Required methods
fn into_json(self, method: &str) -> Result<Value, Error>;
fn from_value(method: &str, value: Value) -> Result<Self, Error>;
}Expand description
Defines the “payload” of a successful response to a JSON-RPC request.
§Derive Macro
Use #[derive(JrResponsePayload)] to automatically implement this trait:
ⓘ
use sacp::JrResponsePayload;
use serde::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize, JrResponsePayload)]
struct HelloResponse {
greeting: String,
}Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.