Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

putAll

Public Function
std.Io.Queue.putAll
pub fn putAll(q: *@This(), io: Io, elements: []const Elem) (QueueClosedError || Cancelable)!void

Same as put but blocks until all elements have been added to the queue.

If the queue is closed or canceled, error.Closed or error.Canceled is returned, and it is unspecified how many, if any, of elements were added to the queue prior to cancelation or closure.

Params

  • q: *@This()
  • io: Io
  • elements: []const Elem

File

Io.zig:2426
2426
2427
2428
2429
2430
2431
2432
        pub fn putAll(q: *@This(), io: Io, elements: []const Elem) (QueueClosedError || Cancelable)!void {
            const n = try q.put(io, elements, elements.len);
            if (n != elements.len) {
                _ = try q.put(io, elements[n..], elements.len - n);
                unreachable; // partial `put` implies queue was closed or we were canceled
            }
        }