Table of Contents

Class IncomingResponseExtensions

Namespace
IceRpc.Slice
Assembly
IceRpc.Slice.dll

Provides extension methods for IncomingResponse to decode its Slice-encoded payload.

public static class IncomingResponseExtensions
Inheritance
IncomingResponseExtensions
Inherited Members

Methods

DecodeReturnValueAsync<T>(IncomingResponse, OutgoingRequest, SliceEncoding, IProxy, DecodeFunc<T>, IActivator?, CancellationToken)

Decodes a response payload.

public static ValueTask<T> DecodeReturnValueAsync<T>(this IncomingResponse response, OutgoingRequest request, SliceEncoding encoding, IProxy sender, DecodeFunc<T> decodeReturnValue, IActivator? defaultActivator = null, CancellationToken cancellationToken = default)

Parameters

response IncomingResponse

The incoming response.

request OutgoingRequest

The outgoing request.

encoding SliceEncoding

The encoding of the response payload.

sender IProxy

The proxy that sent the request.

decodeReturnValue DecodeFunc<T>

A function that decodes the return value.

defaultActivator IActivator

The activator to use when the activator provided by the request's ISliceFeature is null. Used only when encoding is Slice1.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask<T>

A value task that holds the operation's return value. This value task is faulted and holds a SliceException when encoding is Slice1 and the status code is ApplicationError.

Type Parameters

T

The type of the return value.

Exceptions

DispatchException

Thrown when the encoding is Slice1 and the status code of the response is greater than ApplicationError, or when the encoding is Slice2 and the status code is greater than Ok.

DecodeVoidReturnValueAsync(IncomingResponse, OutgoingRequest, IProxy, CancellationToken)

Verifies that a Slice2-encoded response payload carries no return value or only tagged return values.

public static ValueTask DecodeVoidReturnValueAsync(this IncomingResponse response, OutgoingRequest request, IProxy sender, CancellationToken cancellationToken = default)

Parameters

response IncomingResponse

The incoming response.

request OutgoingRequest

The outgoing request.

sender IProxy

The proxy that sent the request (not used by this method).

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask

A value task representing the asynchronous completion of the operation.

Remarks

This method is a ResponseDecodeFunc.

Exceptions

DispatchException

Thrown if the status code of the response is greater than Ok.

DecodeVoidReturnValueAsync(IncomingResponse, OutgoingRequest, SliceEncoding, IProxy, IActivator?, CancellationToken)

Verifies that a Slice-encoded response payload carries no return value or only tagged return values.

public static ValueTask DecodeVoidReturnValueAsync(this IncomingResponse response, OutgoingRequest request, SliceEncoding encoding, IProxy sender, IActivator? defaultActivator = null, CancellationToken cancellationToken = default)

Parameters

response IncomingResponse

The incoming response.

request OutgoingRequest

The outgoing request.

encoding SliceEncoding

The encoding of the response payload.

sender IProxy

The proxy that sent the request.

defaultActivator IActivator

The activator to use when the activator provided by the request's ISliceFeature is null. Used only when encoding is Slice1.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask

A value task representing the asynchronous completion of the operation. This value task is faulted and holds a SliceException when encoding is Slice1 and the status code is ApplicationError.

Exceptions

DispatchException

Thrown when the encoding is Slice1 and the status code of the response is greater than ApplicationError, or when the encoding is Slice2 and the status code is greater than Ok.