feature. See also
. The project being documented here (as the example) is the Zig library itself.
Configuration.LazyPath
pub const LazyPath = union(@This().Tag)
File
Code
pub const LazyPath = union(@This().Tag) {
source_path: SourcePath,
relative: Relative,
generated: Generated,
pub const Tag = enum(u8) {
source_path,
relative,
generated,
};
pub const Flags = packed struct(u32) {
tag: Tag,
_: u24 = 0,
};
pub const Index = enum(u32) {
_,
pub fn get(this: @This(), c: *const Configuration) LazyPath {
return extraData(c, LazyPath, @backingInt(this));
}
};
pub const OptionalIndex = enum(u32) {
none = max_u32,
_,
pub fn unwrap(this: @This()) ?Index {
return switch (this) {
.none => null,
else => @fromBackingInt(@intCast(@backingInt(this))),
};
}
};
pub const SourcePath = struct {
flags: @This().Flags = .{},
owner: Package.Index,
sub_path: String,
pub const Flags = packed struct(u32) {
tag: Tag = .source_path,
_: u24 = 0,
};
};
pub const Generated = struct {
flags: @This().Flags = .{},
index: GeneratedFileIndex,
sub_path: String = .empty,
pub const Flags = packed struct(u32) {
tag: Tag = .generated,
up: u24 = 0,
};
};
pub const Relative = struct {
flags: @This().Flags,
sub_path: String,
pub const Flags = packed struct(u32) {
tag: Tag = .relative,
base: Base,
_: u16 = 0,
};
pub const Base = enum(u8) {
cwd,
local_cache,
global_cache,
build_root,
zig_exe,
zig_lib,
install_prefix,
install_lib,
install_bin,
install_include,
};
};
}