Interface IFieldSink
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
fieldFieldPlanThe field.
bytesReadOnlySpan<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
fieldFieldPlanThe collection field.
totalintHow many elements the entity holds.
sentintHow 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
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
fieldFieldPlanThe field.
componentsReadOnlySpan<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
fieldFieldPlanThe field.
countintThe element count.
componentsReadOnlySpan<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
fieldFieldPlanThe field.
componentsReadOnlySpan<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
fieldFieldPlanThe field.
utf8ReadOnlySpan<byte>The bytes; valid only for the duration of the call.