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 Type Function

FlagLengthPrefixedList

Public Type Function
std.Build.Configuration.Storage.FlagLengthPrefixedList
pub fn FlagLengthPrefixedList(
        comptime flags_arg: @EnumLiteral(),
        comptime flag_arg: @EnumLiteral(),
        comptime ElemArg: type,
    ) type

A field in flags determines whether the length is zero or nonzero. If the length is nonzero, then there is a length field followed by the list. The elements need well-defined memory layout but can otherwise be any multiple of u32 length. The length is the number of elements, not the number of u32s.

Fields

slice: []const Elem

Values

Functions

pub fn initErased(s: []const u32) @This()

File

Build/Configuration.zig:2634
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
    pub fn FlagLengthPrefixedList(
        comptime flags_arg: @EnumLiteral(),
        comptime flag_arg: @EnumLiteral(),
        comptime ElemArg: type,
    ) type {
        return struct {
            slice: []const Elem,

            pub const storage: Storage = .flag_length_prefixed_list;
            pub const flags = flags_arg;
            pub const flag = flag_arg;
            pub const Elem = ElemArg;

            pub fn initErased(s: []const u32) @This() {
                return .{ .slice = @ptrCast(s) };
            }
        };
    }