pack_into_po2

Function pack_into_po2 

Source
pub fn pack_into_po2<T, I>(
    max_size: usize,
    items: I,
) -> Result<PackedItems<T>, ()>
where T: Clone, I: IntoIterator<Item = Item<T>>,
Expand description

Attempts to pack the supplied items into the smallest power of 2 container it possibly can, while not exceeding the provided max_size.

On success, returns the size of the container (a power of 2) and the packed items.