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. Private Struct

PackedOptionalU15

Private Struct
std.compress.flate.Compress.PackedOptionalU15
const PackedOptionalU15 = packed struct(u16)

Until #104 is implemented, a ?u15 takes 4 bytes, which is unacceptable as it doubles the size of this already massive structure.

Also, there are no to / from methods because LLVM 21 does not optimize away the conversion from and to ?u15.

Fields

value: u15
is_null: bool

Values

Functions

pub fn int(p: PackedOptionalU15) u16

File

compress/flate/Compress.zig:36
36
37
38
39
40
41
42
43
44
45
const PackedOptionalU15 = packed struct(u16) {
    value: u15,
    is_null: bool,

    pub fn int(p: PackedOptionalU15) u16 {
        return @bitCast(p);
    }

    pub const null_bit: PackedOptionalU15 = .{ .value = 0, .is_null = true };
}