tiny.zen.FootnotePlan
Defined in tiny.zen.
API (5)
Actions
Public operations.
Fields and members
Public fields and members.
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;Also reachable as
Audit
| Definitions | 3 |
|---|---|
| Public names | 6 |
| Members | 3 |
| Version | 26.7.0 |
| Revision | daab053ee433 |