Zig 0.17.0-dev (Split by item)

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 library itself.

stepUpdateMessage

main.stepUpdateMessage
fn stepUpdateMessage(msg_bytes: []u8) Allocator.Error!void

File

lib/build-web/main.zig:171

Code

fn stepUpdateMessage(msg_bytes: []u8) Allocator.Error!void {
    if (msg_bytes.len < @sizeOf(abi.StepUpdate)) @panic("malformed StepUpdate message");
    const msg: *const abi.StepUpdate = @ptrCast(msg_bytes[0..@sizeOf(abi.StepUpdate)]);
    if (msg.step_idx >= step_list.len) @panic("malformed StepUpdate message");
    step_list[msg.step_idx].status = msg.bits.status;
    js.updateStepStatus(msg.step_idx);
}