tiny.sql.decodeHistoryFetchRequest
Defined in sync.
Source
Source: lib/sql/src/sync.zig:750
zig
pub fn decodeFetchRequest(allocator: Allocator, bytes: []const u8) Error!FetchRequest { var reader = FetchRequestReader.init(bytes); if (try reader.readU32() != fetch_request_magic) return error.InvalidFetchRequest; if (try reader.readU32() != fetch_request_format_version) return error.InvalidFetchRequest; const want_count = try reader.readCount(); const have_count = try reader.readCount(); const wants = try allocator.alloc([]u8, want_count); var wants_read: usize = 0; errdefer { for (wants[0..wants_read]) |want| allocator.free(want); if (wants.len != 0) allocator.free(wants); } for (wants) |*want| { want.* = try reader.readOwnedBytes(allocator); wants_read += 1; } const haves = try allocator.alloc(version.Hash, have_count); errdefer if (haves.len != 0) allocator.free(haves); for (haves) |*have| have.* = try reader.hash(); try reader.finish(); return .{ .allocator = allocator, .wants = wants, .haves = haves, };}Source: lib/sql/src/root.zig:130
zig
pub const decodeHistoryFetchRequest = sync.decodeFetchRequest;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |