pub trait TemporalSerializable {
// Provided methods
fn as_serde(&self) -> Result<&dyn Serialize, PayloadConversionError> { ... }
fn to_payload(
&self,
_: &SerializationContext<'_>,
) -> Result<Payload, PayloadConversionError> { ... }
fn to_payloads(
&self,
ctx: &SerializationContext<'_>,
) -> Result<Vec<Payload>, PayloadConversionError> { ... }
}Expand description
Indicates some type can be serialized for use with Temporal.
You don’t need to implement this unless you are using a non-serde-compatible custom converter, in which case you should implement the to/from_payload functions on some wrapper type.
Provided Methods§
Sourcefn as_serde(&self) -> Result<&dyn Serialize, PayloadConversionError>
fn as_serde(&self) -> Result<&dyn Serialize, PayloadConversionError>
Return a reference to this value as a serde-serializable trait object.
Sourcefn to_payload(
&self,
_: &SerializationContext<'_>,
) -> Result<Payload, PayloadConversionError>
fn to_payload( &self, _: &SerializationContext<'_>, ) -> Result<Payload, PayloadConversionError>
Convert this value into a single Payload.
Sourcefn to_payloads(
&self,
ctx: &SerializationContext<'_>,
) -> Result<Vec<Payload>, PayloadConversionError>
fn to_payloads( &self, ctx: &SerializationContext<'_>, ) -> Result<Vec<Payload>, PayloadConversionError>
Convert to multiple payloads. Override this for types representing multiple arguments.