std.PriorityQueue
The entries of std.PriorityQueue in the Zig reference. This page has 22 cards.
pub fn capacity(self: *const Self) usize
Return the number of elements that can be added to the queue before more memory is allocated.
- Kind
- function
- Module
std.PriorityQueue
pub fn clearAndFree(self: *Self, allocator: Allocator) void
Invalidates all element pointers.
- Kind
- function
- Module
std.PriorityQueue
pub fn clearRetainingCapacity(self: *Self) void
Remove all elements from the items slice.
- Kind
- function
- Module
std.PriorityQueue
pub fn count(self: *const Self) usize
Return the number of elements remaining in the priority queue.
- Kind
- function
- Module
std.PriorityQueue
pub fn deinit(self: *Self, allocator: Allocator) void
Free memory used by the queue.
- Kind
- function
- Module
std.PriorityQueue
A priority queue containing no elements.
- Kind
- constant
- Module
std.PriorityQueue
pub fn ensureTotalCapacity(self: *Self, allocator: Allocator, new_capacity: usize) !void
Ensure that the queue can fit at least `new_capacity` items.
- Kind
- function
- Module
std.PriorityQueue
pub fn ensureTotalCapacityPrecise(self: *Self, allocator: Allocator, new_capacity: usize) !void
If the current capacity is less than `new_capacity`, this function will modify the array so that it can hold exactly `new_capacity` items.
- Kind
- function
- Module
std.PriorityQueue
pub fn ensureUnusedCapacity(self: *Self, allocator: Allocator, additional_count: usize) !void
Ensure that the queue can fit at least `additional_count` **more** item.
- Kind
- function
- Module
std.PriorityQueue
pub fn fromOwnedSlice(items: []T, context: Context) Self
PriorityQueue takes ownership of the passed in slice.
- Kind
- function
- Module
std.PriorityQueue
pub fn initContext(context: Context) Self
Initialize and return a priority queue with context.
- Kind
- function
- Module
std.PriorityQueue
- Kind
- struct
- Module
std.PriorityQueue
pub fn iterator(self: *Self) Iterator
Return an iterator that walks the queue without consuming it.
- Kind
- function
- Module
std.PriorityQueue
pub fn next(it: *Iterator) ?T
- Kind
- function
- Module
std.PriorityQueue
pub fn reset(it: *Iterator) void
- Kind
- function
- Module
std.PriorityQueue
pub fn peek(self: *const Self) ?T
Look at the highest priority element in the queue.
- Kind
- function
- Module
std.PriorityQueue
pub fn pop(self: *Self) ?T
Remove and return the highest priority element from the queue.
- Kind
- function
- Module
std.PriorityQueue
pub fn popIndex(self: *Self, index: usize) T
Remove and return element at index.
- Kind
- function
- Module
std.PriorityQueue
pub fn push(self: *Self, allocator: Allocator, elem: T) !void
Insert a new element, maintaining priority.
- Kind
- function
- Module
std.PriorityQueue
pub fn pushSlice(self: *Self, allocator: Allocator, items: []const T) !void
Add each element in `items` to the queue.
- Kind
- function
- Module
std.PriorityQueue
pub fn shrinkAndFree(self: *Self, allocator: Allocator, new_capacity: usize) void
Reduce allocated capacity to `new_capacity`.
- Kind
- function
- Module
std.PriorityQueue
pub fn update(self: *Self, elem: T, new_elem: T) !void
Replace an element in the queue with a new element, maintaining priority.
- Kind
- function
- Module
std.PriorityQueue