Skip to documentation
SLOP

tiny.zen.DiagramDocumentPlan

Reference tiny.zen DiagramDocumentPlan

Defined in tiny.zen.

API (10)

Actions

Public operations.

Fields and members

Public fields and members.

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

Source

Source: lib/zen/src/diagram/document/plan.zig:13

zig
pub const Plan = struct {    source_bytes: usize,    source_hash: u64,    line_scratch_bytes: usize,    document_bytes: usize,    surveyed: diagram_limits.Limits,    pub fn inspect(line_scratch: []u8, jsonl: []const u8) model.Error!Plan {        const line_scratch_bytes = try requiredLineScratchBytes(jsonl);        if (line_scratch_bytes > line_scratch.len) {            return error.DiagramLineScratchCapacityExceeded;        }        const surveyed = try diagram_limits.survey(            line_scratch[0..line_scratch_bytes],            jsonl,        );        const derived = try diagram_limits.Capacity.derive(surveyed);        return .{            .source_bytes = jsonl.len,            .source_hash = std.hash.Wyhash.hash(0, jsonl),            .line_scratch_bytes = line_scratch_bytes,            .document_bytes = try regionLength(derived.document_bytes),            .surveyed = surveyed,        };    }    pub fn requiredLineScratchBytes(jsonl: []const u8) error{DiagramTooLarge}!usize {        const measured = diagram_limits.measure(jsonl);        return regionLength(try diagram_limits.lineScratchBytes(measured.max_line_bytes));    }    pub fn exactLimits(self: Plan) Limits {        return .{            .max_line_scratch_bytes = self.line_scratch_bytes,            .max_document_bytes = self.document_bytes,        };    }    pub fn require(self: Plan, limits: Limits) model.Exhaustion!void {        if (self.line_scratch_bytes > limits.max_line_scratch_bytes) {            return error.DiagramLineScratchCapacityExceeded;        }        if (self.document_bytes > limits.max_document_bytes) {            return error.DiagramDocumentCapacityExceeded;        }    }    pub fn matches(self: Plan, jsonl: []const u8) bool {        return self.source_bytes == jsonl.len and            self.source_hash == std.hash.Wyhash.hash(0, jsonl);    }};

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

zig
/// Exact diagram-document demand measured before storage acquisition.pub const DiagramDocumentPlan = diagram.DocumentPlan;
Called byCallstest sourcelib.zen.src.diagram.document.plantest: diagram Document plan exposes e...test sourcelib.zen.src.diagram.document.plantest: diagram Document plan rejects e...DiagramDocumentPlanrequiredLineScratchBytesprivate sourcelib.zen.src.diagram.document.planregionLengthDiagramDocumentPlaninspect
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsDiagramDocumentPlaninspecttest sourcelib.zen.src.diagram.document.plantest: diagram Document plan exposes e...test sourcelib.zen.src.diagram.document.plantest: diagram Document plan rejects e...test sourcelib.zen.src.diagram.document.testtest: diagram Document storage reject...private sourcelib.zen.src.diagram.document.planregionLengthDiagramDocumentPlanrequiredLineScratchBytes
Static calls · unresolved targets: 0 · external targets: 2.

Also reachable as

diagram.DocumentPlan, diagram.document.Plan.

Audit

Definitions6
Public names18
Members5
Version26.7.0
Revisiondaab053ee433