pub trait Deserializewhere
Self: Sized,{
type Error: Error + Send + Sync + 'static;
// Required method
fn deserialize(bytes: &mut Bytes) -> Result<Self, Self::Error>;
}
Expand description
Deserialize trait for Restate services.
Default implementations are provided for primitives, and you can use the wrapper type Json
to serialize using serde_json
.
This looks similar to serde::Deserialize
, but allows to plug-in non-serde serialization formats (e.g. like Protobuf using prost
).
Required Associated Types§
Required Methods§
fn deserialize(bytes: &mut Bytes) -> Result<Self, Self::Error>
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.