Referencia Zigconduit-zig (SDK consumido)

zig/driver.zig

Declaraciones públicas de zig/driver.zig (conduit-zig (SDK consumido)).

ImplementadoSin versión del tren todavía· generada desde apps/docs/generated/zig/conduit.json

Página generada desde conduit@conduit-0.1.0-f7J_7zg5DwCsHBHItwdOz9ZVq8cvH7ceFsk7-m3-T61t (zig/root.zig). No se edita a mano: bun run docs:gen la regenera y bun run docs:check falla 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.Source

type · línea 28

pub const Source = struct

Sin ///.

driver.Source.readAt

fn · línea 33

pub fn readAt(s: Source, buf: []u8, offset: u64) anyerror!usize

Sin ///.

driver.Source.fromFile

fn · línea 37

pub fn fromFile(file: *const zkit.fs.File) Source

Sin ///.

driver.Source.fromSlice

fn · línea 48

pub fn fromSlice(bytes: *const []const u8) Source

Sin ///.

driver.Response

type · línea 63

pub const Response = struct

Sin ///.

driver.Transport

type · línea 68

pub const Transport = struct

Sin ///.

driver.Transport.send

fn · línea 74

pub fn send(t: Transport, req: client.Request, chunk: ?[]const u8, resp_body: *std.Io.Writer) Response

Sin ///.

driver.Options

type · línea 79

pub const Options = struct

Sin ///.

driver.EncodingPolicy

type · línea 109

pub const EncodingPolicy = enum

Sin ///.

driver.Stats

type · línea 112

pub const Stats = struct

Bytes the transfer put on the wire, by coding. Updated atomically.

driver.RunError

const · línea 127

pub const RunError = error{ SourceRead, OutOfMemory, ThreadSpawn, Protocol }

Sin ///.

driver.run

fn · línea 147

pub fn run(gpa: Allocator, up: *client.Upload, source: Source, transport: Transport, opts: Options) RunError!void

Drive 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().