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.

DebugLocation

Builder.DebugLocation
pub const DebugLocation = union(enum)

File

lib/std/zig/llvm/Builder.zig:5223

Code

pub const DebugLocation = union(enum) {
    no_location: void,
    location: Location,

    pub const Location = struct {
        line: u32,
        column: u32,
        scope: Builder.Metadata.Optional,
        inlined_at: Builder.Metadata.Optional,
    };

    pub fn toMetadata(self: DebugLocation, builder: *Builder) Allocator.Error!Metadata.Optional {
        return switch (self) {
            .no_location => .none,
            .location => |location| (try builder.debugLocation(
                location.line,
                location.column,
                location.scope.unwrap().?,
                location.inlined_at.unwrap(),
            )).toOptional(),
        };
    }
}