Class NatsSerializationExtensions
Extension methods to support context-aware serialization with fallback to standard serialization.
public static class NatsSerializationExtensions
- Inheritance
-
NatsSerializationExtensions
- Inherited Members
Remarks
Context-aware serializers that want to mutate Headers must check
for null before doing so: the library passes whatever headers the caller supplied to
PublishAsync, and does not allocate a new INatsHeaders for serializers that
opt in to context. Callers who want header-mutating behavior must pass a non-null
headers instance to PublishAsync.
Methods
- Deserialize<T>(INatsDeserialize<T>, in ReadOnlySequence<byte>, in NatsMsgContext)
Deserializes the value with message context, falling back to standard deserialization if not supported.
- Serialize<T>(INatsSerialize<T>, IBufferWriter<byte>, T, in NatsMsgContext)
Serializes the value with message context, falling back to standard serialization if not supported.