Function nix_compat::nar::wire::tag::buf_of

source ·
pub const fn buf_of(xs: &[usize]) -> usize
Expand description

Minimum buffer size to contain either of 0..Tag::MIN and Tag::MIN.. at a particular time, for all possible tag wire representations, given the sizes of all wire representations.

§Example

OFF = 16
MIN = 24
MAX = 64

BUF = max(MIN, MAX-MIN)
    = max(24, 64-24)
    = max(24, 40)
    = 40