Programming Search⌘K

std.Io, page 1 of 2

The entries of std.Io in the Zig reference. This page has 323 cards.

std.Io.async

pub fn async(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) Future(@typeInfo(@TypeOf(function)).@"".return_type.?)

Calls `function` with `args`, such that the return value of the function is not guaranteed to be available until `await` is called. `function` *may* be called immediately, before `async` returns.

Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Batch.init

pub fn init(storage: []Operation.Storage) Batch

After calling this, it is safe to unconditionally defer a call to `cancel`. `storage` is a pre-allocated buffer of undefined memory that determines the maximum number of active operations that can be submitted via `add` and `addAt`.

Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.concurrent

pub fn concurrent(io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) ConcurrentError!Future(@typeInfo(@TypeOf(function)).@"".return_type.?)

Calls `function` with `args`, such that the return value of the function is not guaranteed to be available until `await` is called, allowing the caller to progress while waiting for any `Io` operations.

Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.failingConcurrent

pub fn failingConcurrent(userdata: ?*anyopaque, result_len: usize, result_alignment: std.mem.Alignment, context: []const u8, context_alignment: std.mem.Alignment, start: *const fn (context: *const anyopaque, result: *anyopaque) void) ConcurrentError!*AnyFuture
Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.futexWait

pub fn futexWait(io: Io, comptime T: type, ptr: *align(@alignOf(u32)) const T, expected: T) Cancelable!void

Atomically checks if the value at `ptr` equals `expected`, and if so, blocks until either: * a matching (same `ptr` argument) `futexWake` call occurs, or * a spurious ("random") wakeup occurs.

Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Group.concurrent

pub fn concurrent(g: *Group, io: Io, function: anytype, args: std.meta.ArgsTuple(@TypeOf(function))) ConcurrentError!void

Equivalent to `Io.concurrent`, except the task is spawned in this `Group` instead of becoming associated with a `Future`.

Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Limit.slice1

pub fn slice1(l: Limit, non_empty_buffer: []u8) []u8

Reduces a slice to account for the limit, leaving room for one extra byte above the limit, allowing for the use case of differentiating between end-of-stream and reaching the limit.

Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.Mutex

Mutex is a synchronization primitive which enforces atomic access to a shared region of code known as the "critical section". Mutex is an extern struct so that it may be used as a field inside another extern struct.

Kind
struct
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.

std.Io.noAsync

pub fn noAsync(userdata: ?*anyopaque, result: []u8, result_alignment: std.mem.Alignment, context: []const u8, context_alignment: std.mem.Alignment, start: *const fn (context: *const anyopaque, result: *anyopaque) void) ?*AnyFuture
Kind
function
Module
std.Io

Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.