Typeberry by Fluffy Labs - v0.4.0
    Preparing search index...

    Type Alias Encode<T>

    An encoder for some specific type T.

    type Encode<T> = {
        encode: (encoder: Encoder, elem: T) => void;
        sizeHint: SizeHint;
    }

    Type Parameters

    • T
    Index

    Properties

    Properties

    encode: (encoder: Encoder, elem: T) => void

    Encode given element of type T.

    sizeHint: SizeHint

    A hint about size of that type.

    Can be used as an optimization for how many bytes should be allocated for that type.