pub fn with_capacity_and_extents(capacity: usize, secondary: usize, extents: usize) -> Self {
        if capacity == 0 {
            panic!("capacity must not be zero")
        }
        if secondary == 0 {
            panic!("secondary must not be zero")
        }
        if extents == 0 {
            panic!("extents must not be zero")
        }

        let mut slabs: Vec<Slab<T>> = Vec::with_capacity(extents);
        slabs.push(Slab::<T>::with_capacity(capacity));
        Self {
            primary_capacity: capacity,
            secondary_capacity: secondary,
            slabs,
        }
    }
/// Construct a new, empty `SuperSlab` with the specified capacity.
///
/// The returned slab will be able to store exactly `capacity` without
/// allocating an extent. If `capacity` is 0, a panic will occur.
///
/// It is important to note that this function does not specify the *length*
/// of the returned slab, but only the capacity. For an explanation of the
/// difference between length and capacity, see [Capacity and
/// reallocation](index.html#capacity-and-reallocation).
///
/// # Examples
///
/// ```
/// # use super_slab::*;
///
/// // allocate with a capacity of 10, reserve 4 extents, each with a capacity of 2
/// // this produces two allocation, one for the extents (4 slots) and one for
/// // the primary (10 entries).
///
/// let mut slab = SuperSlab::with_capacity_and_extents(10, 2, 4);
///
/// // The slab contains no values, even though it has capacity for more
/// assert_eq!(slab.len(), 0);
/// assert_eq!(slab.capacity(), 10);
///
/// // These are all done without extending...
/// for i in 0..10 {
///     slab.insert(i);
/// }
///
/// // ...but this will make the super slab add an extent
/// slab.insert(11);
/// assert_eq!(slab.capacity(), 12);
/// ```
Construct a new, empty `SuperSlab` with the specified capacity.
The returned slab will be able to store exactly `capacity` without
allocating an extent. If `capacity` is 0, a panic will occur.

It is important to note that this function does not specify the *length
of the returned slab, but only the capacity. For an explanation of the
difference between length and capacity, see [Capacity and
reallocation](index.html#capacity-and-reallocation).
Construct a new empty ` SuperSlab ` with the specified capacity . The returned slab will be able to store exactly ` capacity ` without allocating an extent . If ` capacity ` is 0 a panic will occur . It is important to note that this function does not specify the * length of the returned slab but only the capacity . For an explanation of the difference between length and capacity see [ Capacity and reallocation ] ( index . html#capacity - and - reallocation ) .
pub fn with_capacity_and_extents(capacity: usize, secondary: usize, extents: usize) -> Self {
        if capacity == 0 {
            panic!("capacity must not be zero")
        }
        if secondary == 0 {
            panic!("secondary must not be zero")
        }
        if extents == 0 {
            panic!("extents must not be zero")
        }
        let mut slabs: Vec<Slab<T>> = Vec::with_capacity(extents);
        slabs.push(Slab::<T>::with_capacity(capacity));
        Self {
            primary_capacity: capacity,
            secondary_capacity: secondary,
            slabs,
        }
    }
pub fn with_capacity_and_extents ( capacity : usize , secondary : usize , extents : usize ) -> Self { if capacity == 0 { panic ! ( " " ) } if secondary == 0 { panic ! ( " " ) } if extents == 0 { panic ! ( " " ) } let mut slabs : Vec < Slab < T > > = Vec :: with_capacity ( extents ) ; slabs . push ( Slab :: < T > :: with_capacity ( capacity ) ) ; Self { primary_capacity : capacity , secondary_capacity : secondary , slabs , } }
Construct a new, empty `SuperSlab` with the specified capacity.
Construct a new empty ` SuperSlab ` with the specified capacity .
capacity
usize
secondary
usize
extents
usize
capacity
usize
secondary
usize
extents
usize
examples
None
use super_slab::*;
allocate with a capacity of 10, reserve 4 extents, each with a capacity of 2
this produces two allocation, one for the extents (4 slots) and one for
the primary (10 entries).

let mut slab = SuperSlab::with_capacity_and_extents(10, 2, 4).

The slab contains no values, even though it has capacity for more
assert_eq!(slab.len(), 0);
assert_eq!(slab.capacity(), 10).

These are all done without extending
for i in 0..10 {
slab.insert(i);
}

but this will make the super slab add an extent
slab.insert(11);
assert_eq!(slab.capacity(), 12);
```
allocate with a capacity of 10 reserve 4 extents each with a capacity of 2 this produces two allocation one for the extents ( 4 slots ) and one for the primary ( 10 entries ) . let mut slab = SuperSlab :: with_capacity_and_extents ( 10 2 4 ) . The slab contains no values even though it has capacity for more assert_eq! ( slab . len () 0 ) ; assert_eq! ( slab . capacity () 10 ) . These are all done without extending for i in 0 .. 10 { slab . insert ( i ) ; } but this will make the super slab add an extent slab . insert ( 11 ) ; assert_eq! ( slab . capacity () 12 ) ; ` ` `