GrpcMarshallerConfig

Available in a dev version: 0․11․0-grpc-186

How to configure

A marker interface for configurations passed to GrpcMarshallers during encoding and decoding operations.

Implementations of this interface can provide marshaller-specific configuration options that control the behavior of message serialization and deserialization. Each marshaller implementation may support different configuration options by defining its own GrpcMarshallerConfig subtype.

Configuration can be passed to marshallers in two ways:

Example:

// Per-operation config
val marshaller = grpcMarshallerOf<MyProtoMessage>()
val encoded = marshaller.encode(message, ProtoConfig(discardUnknownFields = true))

// Default config
val marshallerWithConfig = grpcMarshallerOf<MyProtoMessage>(ProtoConfig(discardUnknownFields = true))
val encoded = marshallerWithConfig.encode(message) // uses the default config

See also