maxEncodedSize

fnsize_t maxEncodedSize(size_t count, ubyte widthBytes) @safe pure nothrow @nogc

Maximum byte length encode* can emit for count values at element width widthBytes (conservative: a varint header per token plus payload; greedy literals pair up, single values may stand alone). Checked against size_t overflow.

Parameters

countnumber of input values.
widthByteselement width W in {1,2,4,8}.

Returns

An upper bound, or size_t.max-sentinel semantics are avoided:

the count itself is rejected by the encoder if the bound would overflow (callers get INSUFFICIENT_CAPACITY from encode).