class documentation

Interface for classes that can use serialization context.

The following classes may implement this interface: - PayloadConverter - PayloadCodec - FailureConverter - EncodingPayloadConverter

During data converter operations (encoding/decoding, serialization/deserialization, and failure conversion), instances of classes implementing this interface will be replaced by the result of calling with_context(context). This allows overridden methods (encode/decode, to_payload/from_payload, etc) to use the context.

Method with_context Return a copy of this object configured to use the given context.
def with_context(self, context: SerializationContext) -> Self: (source) ΒΆ

Return a copy of this object configured to use the given context.

Parameters
context:SerializationContextThe serialization context to use.
Returns
SelfA new instance configured with the context.