dproto.serialize

Serialization/deserialization code

Members

Enums

isProtoInputRange
eponymoustemplate isProtoInputRange(R)

Test a range for being a valid ProtoBuf input range

isProtoOutputRange
eponymoustemplate isProtoOutputRange(R)

Test a range for being a valid ProtoBuf output range

Functions

defaultDecode
void defaultDecode(ulong header, R data)

Removes bytes from the range as if it were read in

fromVarint
T fromVarint(R src)

Decode a VarInt-encoded series of bytes into an unsigned value

fromVarint
T fromVarint(R src)

Decode a VarInt-encoded series of bytes into a signed value

fromZigZag
Signed!T fromZigZag(T src)

Decodes a number from its zigzag encoding

isBuiltinType
bool isBuiltinType(string type)

Returns whether the given string is a protocol buffer primitive

msgNum
ulong msgNum(ulong data)

Get the message number from the encoding value

msgType
auto msgType(string T)

Maps the given type string to the wire type number

readProto
BuffType!T readProto(R src)

Decode a series of bytes into a value

readVarint
T readVarint(R src)

Read a VarInt-encoded value from a data stream

toVarint
void toVarint(R r, T src)

Encode an unsigned value into a VarInt-encoded series of bytes

toVarint
void toVarint(R r, long src)

Encode a signed value into a VarInt-encoded series of bytes

toZigZag
Unsigned!T toZigZag(T src)

Encodes a number in its zigzag encoding

wireType
ubyte wireType(ulong data)

Get the wire type from the encoding value

writeProto
void writeProto(R r, BuffType!T src)

Encode a value into a series of bytes

Manifest constants

ENUM_SERIALIZATION
enum ENUM_SERIALIZATION;

The type to encode an enum as

PACKED_MSG_TYPE
enum PACKED_MSG_TYPE;

The message type to encode a packed message as

Structs

CntRange
struct CntRange

Simple range that ignores data but counts the length

Templates

BuffType
template BuffType(string T)

Maps the given type string to the data type it represents

PossiblyNullable
template PossiblyNullable(T)
Undocumented in source.
SpecifiedDefaultValue
template SpecifiedDefaultValue(T, string value)
Undocumented in source.
UnspecifiedDefaultValue
template UnspecifiedDefaultValue(T)
Undocumented in source.

Meta

Authors

Matthew Soucy, dproto@msoucy.me