type alias Coder

Interface for coders that can encode and decode values.

Type Parameters

TDecoded

The type of the value to encode/decode

Properties

Symbol tag identifying the kind of coder; used to distinguish coder variants without string comparisons.

Encodes a value into a byte buffer and returns the number of bytes written.

Decodes a value from a byte buffer and returns the value with the number of bytes consumed.

Usage

import { type Coder } from "mod.ts";