DoxigAlpha

setEstimatedTotalItems

Thread-safe. 0 means unknown.

Function parameters

Parameters

#
count:usize

Type definitions in this namespace

Types

#
Node
Represents one unit of progress.

Initializes a global Progress instance.

Functions

#
start
Initializes a global Progress instance.
lockStdErr
Allows the caller to freely write to stderr until `unlockStdErr` is called.
lockStderrWriter
Allows the caller to freely write to the returned `Writer`,

= switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }

Values

#
have_ipc
= switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }

Source

Implementation

#
pub fn setEstimatedTotalItems(n: Node, count: usize) void {
    const index = n.index.unwrap() orelse return;
    const storage = storageByIndex(index);
    // Avoid u32 max int which is used to indicate a special state.
    const saturated = @min(std.math.maxInt(u32) - 1, count);
    @atomicStore(u32, &storage.estimated_total_count, saturated, .monotonic);
}