structstd.enums.EnumMap.Iterator[src]

Fields

inner: BitSet.Iterator(.{})
values: *[Indexer.count]Value

Functions

Functionnext[src]

pub fn next(self: *Iterator) ?Entry

Parameters

self: *Iterator

Source Code

Source code
pub fn next(self: *Iterator) ?Entry {
    return if (self.inner.next()) |index|
        Entry{
            .key = Indexer.keyForIndex(index),
            .value = &self.values[index],
        }
    else
        null;
}

Source Code

Source code
pub const Iterator = struct {
    inner: BitSet.Iterator(.{}),
    values: *[Indexer.count]Value,

    pub fn next(self: *Iterator) ?Entry {
        return if (self.inner.next()) |index|
            Entry{
                .key = Indexer.keyForIndex(index),
                .value = &self.values[index],
            }
        else
            null;
    }
}