Declaraciones públicas de zig/resume_state.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.
Resume state of a client upload, kept on disk so a killed process can
continue: a small record (the CLI stores the server's uploadId; a host
may add its own session id) per (file identity, server), under
$XDG_STATE_HOME/<app>/ or ~/.local/state/<app>/, mode 0600, written
with rename so a crash never leaves half a record. The chunk list itself
is never stored: on resume the server's list is the truth (spec §4.3).
The directory comes from the user's environment; once it exists every
access goes through a zkit.safety.fs.Root on it (the record is an entry
of that root: a symlink planted under its name is never followed).
resume_state.max_record_lenconst · línea 16
pub const max_record_len = 1024Sin ///.
resume_state.ResumeStatetype · línea 20
pub const ResumeState = structSin ///.
resume_state.ResumeState.initfn · línea 29
pub fn init( gpa: std.mem.Allocator, environ: *const std.process.Environ.Map, app: []const u8, server: []const u8, file_path: []const u8, st: zkit.fs.Stat, ) std.mem.Allocator.Error!ResumeStateapp names the state directory; server is the base URL (a file
uploaded to two servers resumes separately). environ is the
process environment (XDG_STATE_HOME, HOME). Without a home the state
is disabled (every call is a no-op).
resume_state.ResumeState.deinitfn · línea 60
pub fn deinit(s: *ResumeState, gpa: std.mem.Allocator) voidSin ///.
resume_state.ResumeState.loadfn · línea 70
pub fn load(s: *const ResumeState, buf: *[max_record_len]u8) ?[]const u8The saved record (trimmed), or null.
resume_state.ResumeState.loadUploadIdfn · línea 82
pub fn loadUploadId(s: *const ResumeState) ?wire.UploadIdThe saved record as a bare uploadId (the conduit CLI's format).
resume_state.ResumeState.savefn · línea 88
pub fn save(s: *const ResumeState, record: []const u8) voidBest effort: losing the state only costs a fresh session.
resume_state.ResumeState.clearfn · línea 107
pub fn clear(s: *const ResumeState) voidBest effort, like save.