pub trait Protocol: Clone {
type InnerType: Serialize;
// Required methods
fn new() -> Result<Self>
where Self: Sized;
fn to_request(
&self,
method: &str,
request: &Self::InnerType,
) -> Result<(String, Self::InnerType)>;
fn from_request(
&self,
content: &[u8],
encoding: Option<Encoding>,
) -> Result<Self::InnerType>;
}Expand description
Contract definition of the protocol.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".