View Source EdgeDB.Protocol.Codec protocol (EdgeDB v0.8.0)

A codec knows how to work with the internal binary data from EdgeDB. The binary protocol specification for the codecs can be found in the relevant part of the EdgeDB documentation. Useful links for codec developers:

Summary

Types

Codec ID.

t()

All the types that implement this protocol.

Functions

Function that can decode EdgeDB binary format into an entity.

Function that can encode an entity to EdgeDB binary format.

Types

id()

(since 0.2.0)
@type id() :: bitstring()

Codec ID.

t()

(since 0.2.0)
@type t() :: term()

All the types that implement this protocol.

Functions

decode(codec, data, codec_storage)

(since 0.2.0)
@spec decode(t(), bitstring(), EdgeDB.Protocol.CodecStorage.t()) :: value
when value: term()

Function that can decode EdgeDB binary format into an entity.

encode(codec, value, codec_storage)

(since 0.2.0)
@spec encode(t(), value, EdgeDB.Protocol.CodecStorage.t()) :: iodata()
when value: term()

Function that can encode an entity to EdgeDB binary format.