Method lrs::sync::Queue::new

Creates a new queue with allocated memory.

Syntax

impl<T, H> Queue<T, H>
    where H: Allocator,
          <H as Allocator>::Pool: Default,
{
    fn new(cap: usize) -> Result<Queue<T, H>, Errno>
}

Arguments

NameDescription
cap

The number of elements that can be stored in the queue.

Remarks

The capacity will be increased to the next power of two.