tiny.sandbox.ChangeSet
Defined in change.
API (8)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/sandbox/src/change.zig:64
zig
pub const Set = struct { allocator: Allocator, items: std.ArrayList(Change) = .empty, pub fn init(allocator: Allocator) Set { return .{ .allocator = allocator }; } pub fn deinit(self: *Set) void { for (self.items.items) |*item| item.deinit(self.allocator); self.items.deinit(self.allocator); self.* = undefined; } pub fn append(self: *Set, operation: Operation, entry: Entry) Allocator.Error!void { try self.items.append(self.allocator, .{ .operation = operation, .entry = try entry.clone(self.allocator), }); } pub fn len(self: *const Set) usize { return self.items.items.len; } pub fn get(self: *const Set, index: usize) ?Change { if (index >= self.items.items.len) return null; return self.items.items[index]; } pub fn find(self: *const Set, path: []const u8) ?Change { for (self.items.items) |item| { if (std.mem.eql(u8, item.entry.path, path)) return item; } return null; }};Source: lib/sandbox/src/root.zig:49
zig
pub const ChangeSet = change.Set;Audit
| Definitions | 7 |
|---|---|
| Public names | 14 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |