Skip to main content

compact_bytes_len_from_size

Function compact_bytes_len_from_size 

Source
pub fn compact_bytes_len_from_size(n: usize) -> usize
Expand description

Like compact_bytes_len, but takes the byte count directly rather than a slice.

Use this when you know the content size and do not need to materialise the buffer.

ยงPanics

Panics if a value previously validated by the protocol type no longer satisfies its encoded-length or field-range invariant.