Declaraciones públicas de zig/driver.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.
Runs an Upload with real I/O: concurrency worker threads, a byte
source and a transport. This is what the CLI uses (source = file,
transport = HTTP) and what the tests use against an in-process server.
wire v1: reads that feed the file hash happen under the machine's lock, so they are sequential and in index order (the order the hash needs). wire v2: chunks hash independently, so each worker reads and hashes its chunk outside the lock (every core hashes). Sends always run in parallel outside the lock; each worker is one request in flight, i.e. one connection on HTTP/1.1 (spec v2 §9.2).
How many workers send at once is decided by a flow.Controller in v2
(Options.adaptive): it starts at 2, grows while goodput rises and backs
off on 429, up to concurrency and the session's window. Memory: one
chunk buffer per worker that has had a chunk to read (allocated on first
use), plus an encoder when zstd is on.
driver.Sourcetype · línea 28
pub const Source = structSin ///.
driver.Source.readAtfn · línea 33
pub fn readAt(s: Source, buf: []u8, offset: u64) anyerror!usizeSin ///.
driver.Source.fromFilefn · línea 37
pub fn fromFile(file: *const zkit.fs.File) SourceSin ///.
driver.Source.fromSlicefn · línea 48
pub fn fromSlice(bytes: *const []const u8) SourceSin ///.
driver.Responsetype · línea 63
pub const Response = structSin ///.
driver.Transporttype · línea 68
pub const Transport = structSin ///.
driver.Transport.sendfn · línea 74
pub fn send(t: Transport, req: client.Request, chunk: ?[]const u8, resp_body: *std.Io.Writer) ResponseSin ///.
driver.Optionstype · línea 79
pub const Options = structSin ///.
driver.EncodingPolicytype · línea 109
pub const EncodingPolicy = enumSin ///.
driver.Statstype · línea 112
pub const Stats = structBytes the transfer put on the wire, by coding. Updated atomically.
driver.RunErrorconst · línea 127
pub const RunError = error{ SourceRead, OutOfMemory, ThreadSpawn, Protocol }Sin ///.
driver.runfn · línea 147
pub fn run(gpa: Allocator, up: *client.Upload, source: Source, transport: Transport, opts: Options) RunError!voidDrive up to .done or .failed. Returns an error only for local
failures (source unreadable, OOM, thread spawn, host misuse); protocol
outcomes are in up.failureInfo().