pub trait CustomQuery: Serialize + Clone { }
Expand description
A trait that is required to avoid conflicts with other query types like BankQuery and WasmQuery in generic implementations. You need to implement it in your custom query type.
§Examples
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum MyCustomQuery {
Ping {},
Capitalized { text: String },
}
impl CustomQuery for MyCustomQuery {}
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.