Skip to documentation
SLOP

tiny.zen.FootnotePlan

Reference tiny.zen FootnotePlan

Defined in tiny.zen.

API (5)

Actions

Public operations.

Fields and members

Public fields and members.

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

Source

Source: lib/zen/src/footnote/plan.zig:15

zig
pub const Plan = struct {    source_bytes: usize,    definitions: usize,    joined_text_bytes: usize,    pub fn inspect(source: []const u8, limits: Limits) model.Error!Plan {        var state = State{};        var iterator = scan.Iterator.init(source);        while (iterator.next()) |event| switch (event) {            .definition => |definition| {                state.definitions = try added(state.definitions, 1);                if (state.definitions > limits.max_definitions) {                    return error.FootnoteDefinitionCapacityExceeded;                }                state.current_text_bytes = definition.text.len;                state.current_joined = false;            },            .continuation => |text| try state.join(text, limits.max_joined_text_bytes),        };        std.debug.assert(state.definitions <= limits.max_definitions);        std.debug.assert(state.joined_text_bytes <= limits.max_joined_text_bytes);        return .{            .source_bytes = source.len,            .definitions = state.definitions,            .joined_text_bytes = state.joined_text_bytes,        };    }    pub fn exactLimits(self: Plan) Limits {        return .{            .max_definitions = self.definitions,            .max_joined_text_bytes = self.joined_text_bytes,        };    }};

Source: lib/zen/src/root.zig:121

zig
/// Exact footnote storage demand measured before allocation.pub const FootnotePlan = footnote.Plan;
Called byCallstest sourcelib.zen.src.footnote.plantest: footnote plan borrows every unc...test sourcelib.zen.src.footnote.plantest: footnote plan counts only text ...private sourcelib.zen.src.footnote.planaddedFootnotePlaninspect
Static calls · unresolved targets: 1 · external targets: 2.

Also reachable as

footnote.Plan.

Audit

Definitions3
Public names6
Members3
Version26.7.0
Revisiondaab053ee433