pub fn array_read_capacity(len: i32, remaining: usize) -> usizeExpand description
Initial Vec capacity for a decoded array.
The claimed element count comes off the wire, so it must never be trusted
for allocation — a hostile or corrupt length of i32::MAX would otherwise
reserve gigabytes up front and abort the process under panic = "abort".
The claim is clamped by the bytes actually remaining in the buffer (every
element costs at least one wire byte) and a fixed budget; arrays longer
than the budget grow on demand as elements are actually decoded.