Skip to main content

size_class_for

Function size_class_for 

Source
pub(crate) fn size_class_for(len_bytes: usize) -> Option<usize>
Available on Unix and crate feature pool only.
Expand description

The smallest size class that fits a payload of len_bytes, or None when even the largest class is too small. A selected class always fits: SIZE_CLASSES[class] >= len_bytes, the bound the pool turns into slice lengths over slot memory (proved by the Kani harnesses).