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. Private Function

randomSecure

Private Function
std.Io.Uring.randomSecure
fn randomSecure(userdata: ?*anyopaque, buffer: []u8) Io.RandomSecureError!void

Params

  • userdata: ?*anyopaque
  • buffer: []u8

File

Io/Uring.zig:4975
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
fn randomSecure(userdata: ?*anyopaque, buffer: []u8) Io.RandomSecureError!void {
    const ev: *Evented = @ptrCast(@alignCast(userdata));
    if (buffer.len == 0) return;
    var cancel_region: CancelRegion = .init();
    defer cancel_region.deinit();
    ev.urandomReadAll(&cancel_region, buffer) catch |err| switch (err) {
        error.Canceled => |e| return e,
        else => return error.EntropyUnavailable,
    };
}