Table of Contents

Interface IFieldSink

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

Receives the values of a decoded section, one call per field, in wire order. Implemented as a struct by a zero-allocation decoder, so the generic call is specialized and inlined.

public interface IFieldSink

Methods

Bytes(FieldPlan, scoped ReadOnlySpan<byte>)

A bytes or blob field's content.

void Bytes(FieldPlan field, scoped ReadOnlySpan<byte> bytes)

Parameters

field FieldPlan

The field.

bytes ReadOnlySpan<byte>

The bytes; valid only for the duration of the call.

Collection(FieldPlan, int, int)

A collection field (W34): sent elements follow, each opened by CollectionElement(FieldPlan, int) and made of its element fields' calls (fields whose Parent is field). sent < total is a truncation the server made.

void Collection(FieldPlan field, int total, int sent)

Parameters

field FieldPlan

The collection field.

total int

How many elements the entity holds.

sent int

How many follow.

Remarks

A no-op by default, for the sinks that never meet one — an event or a command carries no collection (W34). A tick sink that decodes entities implements it: a default member called through a struct sink boxes it.

CollectionElement(FieldPlan, int)

Opens element index of field: the calls that follow, up to the next element, are its fields.

void CollectionElement(FieldPlan field, int index)

Parameters

field FieldPlan

The collection field.

index int

The element's index, from 0.

Remarks

A no-op by default, as Collection(FieldPlan, int, int) is.

Integer64(FieldPlan, scoped ReadOnlySpan<ulong>)

A 64-bit integer field's decoded components (Components of them, W32), as bit patterns: the value of a u64 or varu64, the two's complement of an i64 or vari64 — (long)value recovers it. Never a double, which cannot hold them.

void Integer64(FieldPlan field, scoped ReadOnlySpan<ulong> components)

Parameters

field FieldPlan

The field.

components ReadOnlySpan<ulong>

The values; valid only for the duration of the call.

List(FieldPlan, int, scoped ReadOnlySpan<double>)

A list field: count elements of Components numbers each, flattened.

void List(FieldPlan field, int count, scoped ReadOnlySpan<double> components)

Parameters

field FieldPlan

The field.

count int

The element count.

components ReadOnlySpan<double>

The flattened element values; valid only for the duration of the call.

Number(FieldPlan, scoped ReadOnlySpan<double>)

A numeric field's decoded components (Components of them).

void Number(FieldPlan field, scoped ReadOnlySpan<double> components)

Parameters

field FieldPlan

The field.

components ReadOnlySpan<double>

The values; valid only for the duration of the call.

Text(FieldPlan, scoped ReadOnlySpan<byte>)

A text field's validated UTF-8 bytes.

void Text(FieldPlan field, scoped ReadOnlySpan<byte> utf8)

Parameters

field FieldPlan

The field.

utf8 ReadOnlySpan<byte>

The bytes; valid only for the duration of the call.