pub fn FlagLengthPrefixedList(
comptime flags_arg: @EnumLiteral(),
comptime flag_arg: @EnumLiteral(),
comptime ElemArg: type,
) type slice: []const Elempub fn initErased(s: []const u32) @This()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) };
}
};
}
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.