Declaraciones públicas de zig/wire_v2.zig (conduit-zig (SDK consumido)).
apps/docs/generated/zig/conduit.jsonPágina generada desde
conduit@conduit-0.1.0-f7J_7zg5DwCsHBHItwdOz9ZVq8cvH7ceFsk7-m3-T61t (zig/root.zig). No se edita a mano:bun run docs:genla regenera ybun run docs:checkfalla si difiere.
conduit wire v2 — the codec of what v2 adds to v1 in mode chunks
(spec/wire-v2.md §1, §4, §5.4, §10): the create body with "protocol":2,
the v2 session/status/complete responses, the Conduit-Chunk-Cv header and
the stored bitmap. Everything else (ids, routes, Content-Range, error
bodies, the chunk response) is v1's, in wire.zig.
Negotiation (§1): a body or response without protocol is v1 and decodes
exactly as wire.zig does; decode*Any return which one it was.
Same rules as wire.zig (styx dec-0117 B4/I5): exact lengths, lowercase
hex only, overflow-checked integers, no unreachable on input,
freestanding-clean. Mode blobs is parsed (so a server can refuse it
precisely) but its manifest and blob routes are not here yet.
wire_v2.protocolconst · línea 24
pub const protocol: u64 = 2Sin ///.
wire_v2.chunk_cv_headerconst · línea 26
pub const chunk_cv_header = "Conduit-Chunk-Cv"Sin ///.
wire_v2.hex_cv_lenconst · línea 27
pub const hex_cv_len = 64Sin ///.
wire_v2.validChunkSizefn · línea 35
pub fn validChunkSize(cs: u64) boolchunkSize rule of v2 (§4.1): a power of two ≥ 16 KiB (and a JSON-safe
integer), so every chunk is a subtree of the file's BLAKE3 tree.
wire_v2.parseCvfn · línea 40
pub fn parseCv(s: []const u8) ParseError!CvConduit-Chunk-Cv / root / blobId: exactly 64 lowercase hex characters.
wire_v2.hexCvfn · línea 44
pub fn hexCv(cv: Cv) [hex_cv_len]u8Sin ///.
wire_v2.bitmapLenfn · línea 52
pub fn bitmapLen(n: u64) u64Sin ///.
wire_v2.writeBitmapfn · línea 58
pub fn writeBitmap(w: *Writer, n: u64, ctx: anytype, comptime isSet: fn (@TypeOf(ctx), u64) bool) Writer.Error!voidBase64 of the bitmap of n bits whose bit i is isSet(ctx, i),
streamed three bytes at a time (no buffer proportional to n).
wire_v2.decodeBitmapfn · línea 79
pub fn decodeBitmap(arena: std.mem.Allocator, s: []const u8, n: u64) DecodeError![]u8Bitmap bytes of n bits from canonical base64 (§5.4): exact length,
padding, no spare bit set, canonical encoding. Allocated in arena.
wire_v2.bitIsSetfn · línea 96
pub fn bitIsSet(bitmap: []const u8, i: u64) boolSin ///.
wire_v2.Modetype · línea 102
pub const Mode = enumSin ///.
wire_v2.Encodingstype · línea 104
pub const Encodings = structSin ///.
wire_v2.CreateV2type · línea 109
pub const CreateV2 = structSin ///.
wire_v2.Createtype · línea 121
pub const Create = unionSin ///.
wire_v2.decodeCreateAnyfn · línea 127
pub fn decodeCreateAny(arena: std.mem.Allocator, bytes: []const u8) DecodeError!CreateServer side: a create body of either protocol. Strings point into arena.
wire_v2.encodeCreatefn · línea 175
pub fn encodeCreate(w: *Writer, c: CreateV2) Writer.Error!voidClient side, byte-identical to the TS codec (vectors createSession.encode).
wire_v2.Havetype · línea 190
pub const Have = enumSin ///.
wire_v2.SessionV2type · línea 192
pub const SessionV2 = structSin ///.
wire_v2.Sessiontype · línea 207
pub const Session = unionSin ///.
wire_v2.encodeSessionfn · línea 212
pub fn encodeSession(w: *Writer, r: SessionV2) Writer.Error!voidSin ///.
wire_v2.decodeSessionAnyfn · línea 230
pub fn decodeSessionAny(arena: std.mem.Allocator, bytes: []const u8) DecodeError!SessionClient side: the create response of either protocol (§1: no protocol
field = the server spoke v1).
wire_v2.StatusV2type · línea 276
pub const StatusV2 = structSin ///.
wire_v2.Statustype · línea 287
pub const Status = unionSin ///.
wire_v2.encodeStatusfn · línea 293
pub fn encodeStatus(w: *Writer, id: wire.UploadId, mode: Mode, total: u64, confirmed: u64, status: wire.SessionStatus, ctx: anytype, comptime isSet: fn (@TypeOf(ctx), u64) bool) Writer.Error!voidServer side: status with the bitmap streamed from isSet(ctx, i).
wire_v2.decodeStatusAnyfn · línea 301
pub fn decodeStatusAny(arena: std.mem.Allocator, bytes: []const u8) DecodeError!StatusSin ///.
wire_v2.encodeCompleteRequestfn · línea 323
pub fn encodeCompleteRequest(w: *Writer, root: Cv) Writer.Error!voidSin ///.
wire_v2.decodeCompleteRequestfn · línea 329
pub fn decodeCompleteRequest(arena: std.mem.Allocator, bytes: []const u8) DecodeError!?CvServer side: optional body {"root":…}; empty body ⇒ null. A v1
sha256 in a v2 session is refused (one identity per session).
wire_v2.CompleteV2type · línea 338
pub const CompleteV2 = structSin ///.
wire_v2.Completetype · línea 345
pub const Complete = unionSin ///.
wire_v2.encodeCompletefn · línea 350
pub fn encodeComplete(w: *Writer, r: CompleteV2) Writer.Error!voidSin ///.
wire_v2.decodeCompleteAnyfn · línea 358
pub fn decodeCompleteAny(arena: std.mem.Allocator, bytes: []const u8) DecodeError!CompleteSin ///.
wire_v2.chunkHasherfn · línea 375
pub fn chunkHasher(plan: wire.Plan, index: u32) ?tree.SubtreeHasherRange of chunk index of a v2 plan (wire.Plan with a valid v2 chunk
size): an aligned subtree, the last one possibly shorter.