Function setEstimatedTotalItems [src]
Thread-safe. 0 means unknown.
Prototype
pub fn setEstimatedTotalItems(n: Node, count: usize) void
Parameters
n: Node
count: usize
Source
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);
}