Interface ISliceFeature
Represents a feature used to customize the encoding and decoding of request and response payloads.
public interface ISliceFeature
Properties
BaseProxy
Gets the base proxy used when decoding a service address into a proxy.
ISliceProxy? BaseProxy { get; }
Property Value
- ISliceProxy
The base proxy. A decoded proxy inherits the invoker and encode options of the base proxy, and a decoded relative service address is resolved against the service address of the base proxy. When null, the proxy that sent the request serves as the base proxy for a proxy decoded from an incoming response, while a proxy decoded from an incoming request receives Instance as its invoker and keeps its relative service address as is.
EncodeOptions
Gets the options to use when encoding the payload of an outgoing response.
SliceEncodeOptions? EncodeOptions { get; }
Property Value
MaxCollectionAllocation
Gets the maximum collection allocation when decoding a payload, in bytes.
int MaxCollectionAllocation { get; }
Property Value
- int
The maximum collection allocation.
Remarks
This value is a cumulative budget for the decoding of one Slice payload segment, not a limit on the
size of each collection: the decoder charges the estimated memory size of each string, sequence, and
dictionary against this budget before decoding it, based on the size or element count found in the encoded
data, and throws InvalidDataException when the charge exceeds the remaining budget.
Implementations must return a value greater than or equal to 0.
MaxSegmentSize
Gets the maximum size of a Slice payload segment, in bytes. A Slice payload segment corresponds to the encoded arguments of an operation, the encoded return values of an operation, or a portion of a stream of variable-size elements.
int MaxSegmentSize { get; }
Property Value
- int
The maximum size of a Slice payload segment, in bytes.
Remarks
This limit applies only when decoding the payload of an incoming request or response: the decoding
throws InvalidDataException when the size encoded in the size prefix of a segment exceeds this
maximum, before decoding any byte of the segment. It does not restrict the size of the segments encoded by the
application. The segment size does not include the size of its size prefix. Implementations must return a value
greater than 0.