pub trait RPCClientTask:
Sized
+ Debug
+ DeserializeOwned {
type Result: Serialize + DeserializeOwned + Debug;
type ErroredResult: Serialize + DeserializeOwned + Debug;
// Provided method
fn display(&self) -> String { ... }
}Expand description
A Client-side trait that needs to be implemented for a type in order for the client to know return types.
Examples
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct EmailJob {
send_to: String,
contents: String,
}
#[derive(Deserialize, Serialize, Clone, Debug, PartialEq)]
pub struct EmailJobResult {
contents: String,
}
#[derive(Deserialize, Serialize, Clone, Debug, PartialEq)]
pub enum EmailJobResultError {
Errored,
}
impl RPCClientTask for EmailJob {
type ErroredResult = EmailJobResultError;
type Result = EmailJobResult;
}Required Associated Types§
type Result: Serialize + DeserializeOwned + Debug
type ErroredResult: Serialize + DeserializeOwned + Debug
Provided 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.