Represents one unit of progress. Each node can have children nodes, or one can use integers with update
.
Fields
context: *Progress,
parent: ?*Node,
name: []const u8,
unit: []const u8 = "",
recently_updated_child: ?*Node = null,
Must be handled atomically to be thread-safe.
unprotected_estimated_total_items: usize,
Must be handled atomically to be thread-safe. 0 means null.
unprotected_completed_items: usize,
Must be handled atomically to be thread-safe.
Functions
fn activate(self: *Node) void
Tell the parent node that this node is actively being worked on. Thread-safe.
fn start(self: *Node, name: []const u8, estimated_total_items: usize) Node
Create a new child progress node. Thread-safe. Call
Node.end
when done. TODO…Create a new child progress node. Thread-safe. Call
Node.end
when done. TODO solve https://github.com/ziglang/zig/issues/2765 and then change this API to setself.parent.recently_updated_child
with the return value. Until that is fixed you probably want to callactivate
on the return value. Passing 0 forestimated_total_items
means unknown.