tiny.sandbox.Result
Defined in result.
Holds the resources and captured outputs of an execution, owning the standard output and standard error buffers, the recorded change set, the configuration Audit, and the layer directory.
API (9)
Actions
Public operations.
deinitreadFileAlloc: Reads an output file through the layer directory handle into a buffer allocated withallocator, transferring ownership of the slice to the caller, who must free it using the supplied allocator.
Fields and members
Public fields and members.
Source
Source: lib/sandbox/src/result.zig:16
zig
/// Holds the resources and captured outputs of an execution, owning the/// standard output and standard error buffers, the recorded change set, the/// configuration `Audit`, and the layer directory.////// Calling `deinit` frees the stream buffers and change set memory, then/// deletes the temporary layer directory. Callers that want to keep files/// generated in the layer must read or copy them out before calling `deinit`.pub const Result = struct { allocator: Allocator, layer: layer_data.Layer, status: command.Status, stdout: []u8, stderr: []u8, changes: change.Set, audit: audit_data.Audit, pub fn deinit(self: *Result) void { self.changes.deinit(); self.allocator.free(self.stdout); self.allocator.free(self.stderr); self.layer.deinit(); self.* = undefined; } /// Reads an output file through the layer directory handle into a buffer /// allocated with `allocator`, transferring ownership of the slice to the /// caller, who must free it using the supplied allocator. Relative path /// resolution starts at the root of the layer directory but performs no /// path-containment checks, allowing lookups that navigate outside the /// layer. The `limit` argument sets the maximum number of bytes to read. pub fn readFileAlloc(self: *const Result, allocator: Allocator, path: []const u8, limit: usize) ![]u8 { return try self.layer.readFileAlloc(allocator, path, limit); }};Source: lib/sandbox/src/root.zig:61
zig
pub const Result = result.Result;Also reachable as
Audit
| Definitions | 3 |
|---|---|
| Public names | 9 |
| Members | 7 |
| Version | 26.7.0 |
| Revision | daab053ee433 |