Table of Contents

Struct MessageFieldValue

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

One message field's value, widened without loss: every type up to 32 bits and both floating types as a double (exact — a float widens and narrows back to the same bits), a 64-bit integer as its bits.

public readonly struct MessageFieldValue
Inherited Members

Properties

Integer64Bits

A 64-bit integer's bits (two's complement for a signed one); 0 for a number.

public ulong Integer64Bits { get; }

Property Value

ulong

IsInteger64

Whether the value is a 64-bit integer.

public bool IsInteger64 { get; }

Property Value

bool

Number

The value as a number: exact for every type but a 64-bit integer, which rounds as a (double) cast does.

public double Number { get; }

Property Value

double

Methods

Of(double)

A value of 32 bits or fewer, or a floating one.

public static MessageFieldValue Of(double value)

Parameters

value double

The value.

Returns

MessageFieldValue

The field value.

Of(long)

A signed 64-bit value.

public static MessageFieldValue Of(long value)

Parameters

value long

The value.

Returns

MessageFieldValue

The field value.

Of(ulong)

An unsigned 64-bit value.

public static MessageFieldValue Of(ulong value)

Parameters

value ulong

The value.

Returns

MessageFieldValue

The field value.