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. Public Union

LazyPath

Public Union
std.Build.Configuration.LazyPath
pub const LazyPath = union(@This().Tag)

Fields

source_path: SourcePath
relative: Relative
generated: Generated

Structs

Types

Values

  • pub const Index

    An index into extra.

File

Build/Configuration.zig:1491
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
pub const LazyPath = union(@This().Tag) {
    source_path: SourcePath,
    relative: Relative,
    generated: Generated,

    pub const Tag = enum(u8) {
        /// A source file path relative to build root.
        source_path,
        /// Relative to the directory indicated in flags.
        relative,
        /// Path is available only after it is populated by its owning step.
        generated,
    };

    pub const Flags = packed struct(u32) {
        tag: Tag,
        _: u24 = 0,
    };

    /// An index into `extra`.
    pub const Index = IndexType(@This());

    /// An index into `extra`, or `null`.
    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,
        /// Applied after `up`.
        sub_path: String = .empty,

        pub const Flags = packed struct(u32) {
            tag: Tag = .generated,
            /// The number of parent directories to go up.
            /// 0 means the generated file itself.
            /// 1 means the directory of the generated file.
            /// 2 means the parent of that directory, and so on.
            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,
            /// Must not be used with Relative since package index is missing.
            build_root,
            zig_exe,
            zig_lib,
            install_prefix,
            install_lib,
            install_bin,
            install_include,
        };
    };
}