Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

Iterator

Public Struct
std.array_hash_map.ArrayHashMap.Iterator
pub const Iterator = struct

Fields

keys: [*]K
values: [*]V
len: u32
index: u32 = 0

Functions

pub fn next(it: *Iterator) ?Entry
pub fn reset(it: *Iterator) void

Reset the iterator to the initial index

File

array_hash_map.zig:272
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
        pub const Iterator = struct {
            keys: [*]K,
            values: [*]V,
            len: u32,
            index: u32 = 0,

            pub fn next(it: *Iterator) ?Entry {
                if (it.index >= it.len) return null;
                const result = Entry{
                    .key_ptr = &it.keys[it.index],
                    .value_ptr = &it.values[it.index],
                };
                it.index += 1;
                return result;
            }

            /// Reset the iterator to the initial index
            pub fn reset(it: *Iterator) void {
                it.index = 0;
            }
        }