pub trait Side: Clone {
type InRequest: Clone + Serialize + DeserializeOwned + JsonSchema + 'static;
type InNotification: Clone + Serialize + DeserializeOwned + JsonSchema + 'static;
type OutResponse: Clone + Serialize + DeserializeOwned + JsonSchema + 'static;
// Required methods
fn decode_request(
method: &str,
params: Option<&RawValue>,
) -> Result<Self::InRequest>;
fn decode_notification(
method: &str,
params: Option<&RawValue>,
) -> Result<Self::InNotification>;
}Required Associated Types§
type InRequest: Clone + Serialize + DeserializeOwned + JsonSchema + 'static
type InNotification: Clone + Serialize + DeserializeOwned + JsonSchema + 'static
type OutResponse: Clone + Serialize + DeserializeOwned + JsonSchema + 'static
Required Methods§
Sourcefn decode_request(
method: &str,
params: Option<&RawValue>,
) -> Result<Self::InRequest>
fn decode_request( method: &str, params: Option<&RawValue>, ) -> Result<Self::InRequest>
Decode a request for a given method. This will encapsulate the knowledge of mapping which serialization struct to use for each method.
§Errors
This function will return an error if the method is not recognized or if the parameters cannot be deserialized into the expected type.
Sourcefn decode_notification(
method: &str,
params: Option<&RawValue>,
) -> Result<Self::InNotification>
fn decode_notification( method: &str, params: Option<&RawValue>, ) -> Result<Self::InNotification>
Decode a notification for a given method. This will encapsulate the knowledge of mapping which serialization struct to use for each method.
§Errors
This function will return an error if the method is not recognized or if the parameters cannot be deserialized into the expected type.
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.