tiny.sandbox.Snapshot
Defined in scan.
API (7)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/sandbox/src/scan.zig:8
zig
pub const Snapshot = struct { allocator: Allocator, entries: std.ArrayList(change.Entry) = .empty, pub fn init(allocator: Allocator) Snapshot { return .{ .allocator = allocator }; } pub fn deinit(self: *Snapshot) void { for (self.entries.items) |*entry| entry.deinit(self.allocator); self.entries.deinit(self.allocator); self.* = undefined; } pub fn append(self: *Snapshot, entry: change.Entry) Allocator.Error!void { try self.entries.append(self.allocator, try entry.clone(self.allocator)); } pub fn find(self: *const Snapshot, path: []const u8) ?change.Entry { for (self.entries.items) |entry| { if (std.mem.eql(u8, entry.path, path)) return entry; } return null; } pub fn sort(self: *Snapshot) void { std.mem.sort(change.Entry, self.entries.items, {}, lessThan); }};Source: lib/sandbox/src/root.zig:63
zig
pub const Snapshot = scan.Snapshot;Audit
| Definitions | 6 |
|---|---|
| Public names | 12 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |