pub trait JrRequest: JrMessage {
type Response: JrResponsePayload;
}Expand description
A struct that represents a request (JSON-RPC message expecting a response).
§Derive Macro
Use #[derive(JrRequest)] to automatically implement both JrMessage and JrRequest:
ⓘ
use sacp::{JrRequest, JrResponsePayload};
use serde::{Serialize, Deserialize};
#[derive(Debug, Clone, Serialize, Deserialize, JrRequest)]
#[request(method = "_hello", response = HelloResponse)]
struct HelloRequest {
name: String,
}
#[derive(Debug, Serialize, Deserialize, JrResponsePayload)]
struct HelloResponse {
greeting: String,
}Required Associated Types§
Sourcetype Response: JrResponsePayload
type Response: JrResponsePayload
The type of data expected in response.
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.