std.Deque.at
pub fn at(deque: *const Self, index: usize) T
Return the item at the given index in the deque.
- Kind
- function
- Module
std.Deque
Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
The entries of std.Deque in the Zig reference. This page has 33 cards.
pub fn at(deque: *const Self, index: usize) T
Return the item at the given index in the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn atPtr(deque: *const Self, index: usize) *T
Return pointer to the item at the given index in the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn back(deque: *const Self) ?T
Return the last item in the deque or null if empty.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn backPtr(deque: *const Self) ?*T
Return the last item in the deque or null if empty.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn deinit(deque: *Self, gpa: Allocator) void
Release all allocated memory.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
A Deque containing no elements.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn ensureTotalCapacity(deque: *Self, gpa: Allocator, new_capacity: usize) Allocator.Error!void
Modify the deque so that it can hold at least `new_capacity` items.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn ensureTotalCapacityPrecise(deque: *Self, gpa: Allocator, new_capacity: usize) Allocator.Error!void
If the current capacity is less than `new_capacity`, this function will modify the deque so that it can hold exactly `new_capacity` items.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn ensureUnusedCapacity(deque: *Self, gpa: Allocator, additional_count: usize) Allocator.Error!void
Modify the deque so that it can hold at least `additional_count` **more** items.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn front(deque: *const Self) ?T
Return the first item in the deque or null if empty.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn frontPtr(deque: *const Self) ?*T
Return pointer to the first item in the deque or null if empty.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn initBuffer(buffer: []T) Self
Initialize with externally-managed memory.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn initCapacity(gpa: Allocator, capacity: usize) Allocator.Error!Self
Initialize with capacity to hold `capacity` elements.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn iterator(deque: *const Self) Iterator
Iterates over all items in the deque in order from front to back.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn next(it: *Iterator) ?T
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn nextPtr(it: *Iterator) ?*T
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn peek(it: Iterator) ?T
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn peekPtr(it: Iterator) ?*T
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn popBack(deque: *Self) ?T
Remove and return the last item in the deque or null if empty.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn popFront(deque: *Self) ?T
Remove and return the first item in the deque or null if empty.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushBack(deque: *Self, gpa: Allocator, item: T) error
Add one item to the back of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushBackAssumeCapacity(deque: *Self, item: T) void
Add one item to the back of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushBackBounded(deque: *Self, item: T) error
Add one item to the back of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushBackSlice(deque: *Self, gpa: Allocator, items: []const T) error
Add `items` to the back of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushBackSliceAssumeCapacity(deque: *Self, items: []const T) void
Add `items` to the back of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushBackSliceBounded(deque: *Self, items: []const T) error
Add `items` to the back of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushFront(deque: *Self, gpa: Allocator, item: T) error
Add one item to the front of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushFrontAssumeCapacity(deque: *Self, item: T) void
Add one item to the front of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushFrontBounded(deque: *Self, item: T) error
Add one item to the front of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushFrontSlice(deque: *Self, gpa: Allocator, items: []const T) error
Add `items` to the front of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushFrontSliceAssumeCapacity(deque: *Self, items: []const T) void
Add `items` to the front of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn pushFrontSliceBounded(deque: *Self, items: []const T) error
Add `items` to the front of the deque.
std.DequeSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.