std.MultiArrayList
The entries of std.MultiArrayList in the Zig reference. This page has 47 cards.
pub fn addOne(self: *Self, gpa: Allocator) Allocator.Error!usize
Extend the list by 1 element, returning the newly reserved index with uninitialized data.
- Kind
- function
- Module
std.MultiArrayList
pub fn addOneAssumeCapacity(self: *Self) usize
Extend the list by 1 element, returning the newly reserved index with uninitialized data.
- Kind
- function
- Module
std.MultiArrayList
pub fn addOneBounded(self: *Self) error
Extend the list by 1 element, returning the newly reserved index with uninitialized data.
- Kind
- function
- Module
std.MultiArrayList
pub fn append(self: *Self, gpa: Allocator, elem: T) Allocator.Error!void
Extend the list by 1 element.
- Kind
- function
- Module
std.MultiArrayList
pub fn appendAssumeCapacity(self: *Self, elem: T) void
Extend the list by 1 element.
- Kind
- function
- Module
std.MultiArrayList
pub fn appendBounded(self: *Self, elem: T) error
Extend the list by 1 element.
- Kind
- function
- Module
std.MultiArrayList
pub fn capacityInBytes(capacity: usize) usize
- Kind
- function
- Module
std.MultiArrayList
pub fn clearAndFree(self: *Self, gpa: Allocator) void
- Kind
- function
- Module
std.MultiArrayList
pub fn clearRetainingCapacity(self: *Self) void
Invalidates all element pointers.
- Kind
- function
- Module
std.MultiArrayList
pub fn clone(self: Self, gpa: Allocator) Allocator.Error!Self
Create a copy of this list with a new backing store, using the specified allocator.
- Kind
- function
- Module
std.MultiArrayList
pub fn deinit(self: *Self, gpa: Allocator) void
Release all allocated memory.
- Kind
- function
- Module
std.MultiArrayList
- Kind
- constant
- Module
std.MultiArrayList
pub fn ensureTotalCapacity(self: *Self, gpa: Allocator, new_capacity: usize) Allocator.Error!void
Modify the array so that it can hold at least `new_capacity` items.
- Kind
- function
- Module
std.MultiArrayList
pub fn ensureUnusedCapacity(self: *Self, gpa: Allocator, additional_count: usize) Allocator.Error!void
Modify the array so that it can hold at least `additional_count` **more** items.
- Kind
- function
- Module
std.MultiArrayList
- Kind
- type
- Module
std.MultiArrayList
pub fn get(self: Self, index: usize) T
Obtain all the data for one array element.
- Kind
- function
- Module
std.MultiArrayList
pub fn growCapacity(minimum: usize) usize
Given a lower bound of required memory capacity, returns a larger value with super-linear growth.
- Kind
- function
- Module
std.MultiArrayList
pub fn initCapacity(gpa: Allocator, num: usize) Allocator.Error!Self
Initialize with capacity to hold exactly `num` elements.
- Kind
- function
- Module
std.MultiArrayList
pub fn insert(self: *Self, gpa: Allocator, index: usize, elem: T) !void
Inserts an item into the list.
- Kind
- function
- Module
std.MultiArrayList
pub fn insertAssumeCapacity(self: *Self, index: usize, elem: T) void
Inserts an item into the list.
- Kind
- function
- Module
std.MultiArrayList
pub fn insertBounded(self: *Self, index: usize, elem: T) error
Inserts an item into the list.
- Kind
- function
- Module
std.MultiArrayList
pub fn items(self: Self, comptime field: Field) []FieldType(field)
Get the slice of values for a specified field.
- Kind
- function
- Module
std.MultiArrayList
pub fn orderedRemove(self: *Self, index: usize) void
Remove the specified item from the list, shifting items after it to preserve order.
- Kind
- function
- Module
std.MultiArrayList
pub fn orderedRemoveMany(self: *Self, sorted_indexes: []const usize) void
Remove the elements indexed by `sorted_indexes`.
- Kind
- function
- Module
std.MultiArrayList
pub fn pop(self: *Self) ?T
Remove and return the last element from the list, or return `null` if list is empty.
- Kind
- function
- Module
std.MultiArrayList
pub fn resize(self: *Self, gpa: Allocator, new_len: usize) Allocator.Error!void
Adjust the list's length to `new_len`.
- Kind
- function
- Module
std.MultiArrayList
pub fn set(self: *Self, index: usize, elem: T) void
Overwrite one array element with new data.
- Kind
- function
- Module
std.MultiArrayList
pub fn setCapacity(self: *Self, gpa: Allocator, new_capacity: usize) Allocator.Error!void
Modify the array so that it can hold exactly `new_capacity` items.
- Kind
- function
- Module
std.MultiArrayList
pub fn shrinkAndFree(self: *Self, gpa: Allocator, new_len: usize) void
Attempt to reduce allocated capacity to `new_len`.
- Kind
- function
- Module
std.MultiArrayList
pub fn shrinkRetainingCapacity(self: *Self, new_len: usize) void
Reduce length to `new_len`.
- Kind
- function
- Module
std.MultiArrayList
A MultiArrayList.Slice contains cached start pointers for each field in the list.
- Kind
- struct
- Module
std.MultiArrayList
pub fn slice(self: Self) Slice
Compute pointers to the start of each field of the array.
- Kind
- function
- Module
std.MultiArrayList
pub fn deinit(self: *Slice, gpa: Allocator) void
- Kind
- function
- Module
std.MultiArrayList
- Kind
- constant
- Module
std.MultiArrayList
pub fn get(self: Slice, index: usize) T
- Kind
- function
- Module
std.MultiArrayList
pub fn items(self: Slice, comptime field: Field) []FieldType(field)
- Kind
- function
- Module
std.MultiArrayList
pub fn set(self: *Slice, index: usize, elem: T) void
- Kind
- function
- Module
std.MultiArrayList
pub fn subslice(s: Slice, off: usize, len: usize) Slice
Returns a `Slice` representing a range of elements in `s`, analagous to `arr[off..len]`.
- Kind
- function
- Module
std.MultiArrayList
pub fn swap(self: Slice, a: usize, b: usize) void
- Kind
- function
- Module
std.MultiArrayList
pub fn toMultiArrayList(self: Slice) Self
- Kind
- function
- Module
std.MultiArrayList
pub fn sort(self: Self, ctx: anytype) void
This function guarantees a stable sort, i.e the relative order of equal elements is preserved during sorting.
- Kind
- function
- Module
std.MultiArrayList
pub fn sortSpan(self: Self, a: usize, b: usize, ctx: anytype) void
Sorts only the subsection of items between indices `a` and `b` (excluding `b`) This function guarantees a stable sort, i.e the relative order of equal elements is preserved during sorting.
- Kind
- function
- Module
std.MultiArrayList
pub fn sortSpanUnstable(self: Self, a: usize, b: usize, ctx: anytype) void
Sorts only the subsection of items between indices `a` and `b` (excluding `b`) This function does NOT guarantee a stable sort, i.e the relative order of equal elements may change during sorting.
- Kind
- function
- Module
std.MultiArrayList
pub fn sortUnstable(self: Self, ctx: anytype) void
This function does NOT guarantee a stable sort, i.e the relative order of equal elements may change during sorting.
- Kind
- function
- Module
std.MultiArrayList
pub fn swap(self: Self, a: usize, b: usize) void
- Kind
- function
- Module
std.MultiArrayList
pub fn swapRemove(self: *Self, index: usize) void
Remove the specified item from the list, swapping the last item in the list into its position.
- Kind
- function
- Module
std.MultiArrayList
pub fn toOwnedSlice(self: *Self) Slice
The caller owns the returned memory.
- Kind
- function
- Module
std.MultiArrayList