MIME type of the bytes produced by serialize (and accepted by
deserialize).
Optional ReadonlyjsonOptional JSON Schema describing the logical shape of T. Surfaced in
discovery so that tooling can generate forms, auto-complete payloads,
etc. Has no effect on serialization at runtime.
Convert on-the-wire bytes back into a value of type T. Must be the
inverse of serialize.
May throw if data doesn't conform to the expected wire format.
Convert a value of type T into its on-the-wire bytes. This is the
format Restate sends between services and persists in the journal.
Must be the inverse of deserialize — deserialize(serialize(v))
should produce a value equivalent to v.
Serializer/deserializer pair for any Restate-managed value of type
T— handler inputs and outputs, service state, side-effect results, awakeables, durable promises, and so on.A
Serde<T>is responsible for two conversions:serialize/deserializeconvert a valueTto and from the raw bytes that flow over the network and get stored in the journal.preview.toJsonString/preview.fromJsonStringconvert a valueTto and from a JSON string, used by tooling to render and edit values that humans can read.It also advertises metadata (
contentType,jsonSchema) that surfaces in service discovery.