Skip to documentation
SLOP

tiny.arrange.IndexedInput

Reference tiny.arrange IndexedInput

Defined in tiny.arrange.

API (7)

Types and contracts

Public types and contracts.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.arrangeIndexedInput
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/arrange/src/compute.zig:62

zig
pub const IndexedInput = struct {    context: ?*anyopaque,    count: u32,    get: *const fn (?*anyopaque, u32) Node,    descendants: *const fn (?*anyopaque, u32) u32,    is_leaf: ?*const fn (?*anyopaque, u32) bool = null,    rects: []Rect,    pub const flat = true;    fn node(self: IndexedInput, index: usize) Node {        std.debug.assert(index < self.count);        return self.get(self.context, @intCast(index));    }    fn children(self: IndexedInput, index: usize) IndexedChildren {        const end = index + self.descendants(self.context, @intCast(index)) + 1;        std.debug.assert(end <= self.count);        return .{ .source = self, .cursor = index + 1, .end = end };    }    fn childCount(self: IndexedInput, index: usize) usize {        if (self.is_leaf) |is_leaf| {            if (is_leaf(self.context, @intCast(index))) return 0;        }        var iter = self.children(index);        var count: usize = 0;        while (iter.next()) |_| count += 1;        return count;    }    fn recordRect(self: IndexedInput, index: usize, rect: Rect) void {        self.rects[index] = rect;    }};

Source: lib/arrange/src/root.zig:35

zig
pub const IndexedInput = compute.IndexedInput;

Audit

Definitions2
Public names2
Members6
Version26.7.0
Revisiondaab053ee433