tiny.sql.HistoryRemoteConfig
Defined in sync.
API (6)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/sql/src/sync.zig:145
zig
pub const RemoteConfig = struct { allocator: Allocator, remotes: []RemoteConfigEntry, pub fn init(allocator: Allocator, remotes: []const RemoteConfigEntry) Error!RemoteConfig { try validateRemoteEntries(remotes); const owned = try allocator.alloc(RemoteConfigEntry, remotes.len); var count: usize = 0; errdefer { for (owned[0..count]) |*remote| remote.deinit(allocator); if (owned.len != 0) allocator.free(owned); } for (remotes, owned) |remote, *target| { target.* = try RemoteConfigEntry.initWithDefaultBranch(allocator, remote.name, remote.history_path, remote.lock_path, remote.default_branch); count += 1; } return .{ .allocator = allocator, .remotes = owned, }; } pub fn deinit(self: *RemoteConfig) void { for (self.remotes) |*remote| remote.deinit(self.allocator); if (self.remotes.len != 0) self.allocator.free(self.remotes); self.* = undefined; } pub fn find(self: *const RemoteConfig, name: []const u8) ?*const RemoteConfigEntry { for (self.remotes) |*remote| { if (std.mem.eql(u8, remote.name, name)) return remote; } return null; } pub fn fileRemote(self: *const RemoteConfig, io: std.Io, dir: std.Io.Dir, name: []const u8) Error!FileRemote { const remote = self.find(name) orelse return error.RemoteNotFound; return remote.fileRemote(io, dir); }};Source: lib/sql/src/root.zig:106
zig
pub const HistoryRemoteConfig = sync.RemoteConfig;Audit
| Definitions | 5 |
|---|---|
| Public names | 10 |
| Members | 2 |
| Version | 26.7.0 |
| Revision | daab053ee433 |