pub trait Serialize {
type Error: Error + Send + Sync + 'static;
// Required method
fn serialize(&self) -> Result<Bytes, Self::Error>;
}
Expand description
Serialize 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::Serialize
, but allows to plug-in non-serde serialization formats (e.g. like Protobuf using prost
).