authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-24 13:56:13-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-29 23:50:19-07:00
log91a08af5702cba683ae2d418ff57307f159e3281
treeda8d44d51e03985bebd11dcf412033ff48d984af
parentd4b70505551ecf568f8af7375cb0e6e5aea97cfb

std.Progress: move Options closer to where it is used

no functional change

1 files changed, 19 insertions(+), 19 deletions(-)

lib/std/Progress.zig+19-19
...@@ -165,25 +165,6 @@ pub const TerminalMode = union(enum) {...@@ -165,25 +165,6 @@ pub const TerminalMode = union(enum) {
165 };165 };
166};166};
167167
168pub const Options = struct {
169 /// User-provided buffer with static lifetime.
170 ///
171 /// Used to store the entire write buffer sent to the terminal. Progress output will be truncated if it
172 /// cannot fit into this buffer which will look bad but not cause any malfunctions.
173 ///
174 /// Must be at least 200 bytes.
175 draw_buffer: []u8 = &default_draw_buffer,
176 /// How many nanoseconds between writing updates to the terminal.
177 refresh_rate_ns: Io.Duration = .fromMilliseconds(80),
178 /// How many nanoseconds to keep the output hidden
179 initial_delay_ns: Io.Duration = .fromMilliseconds(200),
180 /// If provided, causes the progress item to have a denominator.
181 /// 0 means unknown.
182 estimated_total_items: usize = 0,
183 root_name: []const u8 = "",
184 disable_printing: bool = false,
185};
186
187/// Represents one unit of progress. Each node can have children nodes, or168/// Represents one unit of progress. Each node can have children nodes, or
188/// one can use integers with `update`.169/// one can use integers with `update`.
189pub const Node = struct {170pub const Node = struct {
...@@ -578,6 +559,25 @@ pub const ParentFileError = error{...@@ -578,6 +559,25 @@ pub const ParentFileError = error{
578 UnrecognizedFormat,559 UnrecognizedFormat,
579};560};
580561
562pub const Options = struct {
563 /// User-provided buffer with static lifetime.
564 ///
565 /// Used to store the entire write buffer sent to the terminal. Progress output will be truncated if it
566 /// cannot fit into this buffer which will look bad but not cause any malfunctions.
567 ///
568 /// Must be at least 200 bytes.
569 draw_buffer: []u8 = &default_draw_buffer,
570 /// How many nanoseconds between writing updates to the terminal.
571 refresh_rate_ns: Io.Duration = .fromMilliseconds(80),
572 /// How many nanoseconds to keep the output hidden
573 initial_delay_ns: Io.Duration = .fromMilliseconds(200),
574 /// If provided, causes the progress item to have a denominator.
575 /// 0 means unknown.
576 estimated_total_items: usize = 0,
577 root_name: []const u8 = "",
578 disable_printing: bool = false,
579};
580
581/// Initializes a global Progress instance.581/// Initializes a global Progress instance.
582///582///
583/// Asserts there is only one global Progress instance.583/// Asserts there is only one global Progress instance.