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

    Interface CodecWithView<T, V>

    A codec descriptor with extra view.

    interface CodecWithView<T, V> {
        decode: (d: Decoder) => T;
        encode: (encoder: Encoder, elem: T) => void;
        sizeHint: SizeHint;
        View: Codec<V>;
    }

    Type Parameters

    • T
    • V

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    decode: (d: Decoder) => T

    Decode object of type T.

    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.

    View: Codec<V>

    encoded data view codec.