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 Namespace

TableAdapter

Public Namespace
std.Build.Cache.Path.TableAdapter
pub const TableAdapter = struct

Useful to make Path a key in std.ArrayHashMap.

Structs

Functions

pub fn hash(self: TableAdapter, a: Cache.Path) u32
pub fn eql(self: TableAdapter, a: Cache.Path, b: Cache.Path, b_index: usize) bool

File

Build/Cache/Path.zig:220
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
pub const TableAdapter = struct {
    pub const Hash = std.hash.Wyhash;

    pub fn hash(self: TableAdapter, a: Cache.Path) u32 {
        _ = self;
        const seed = switch (@typeInfo(@TypeOf(a.root_dir.handle.handle))) {
            .pointer => @intFromPtr(a.root_dir.handle.handle),
            .int => @as(u32, @bitCast(a.root_dir.handle.handle)),
            else => @compileError("unimplemented hash function"),
        };
        return @truncate(Hash.hash(seed, a.sub_path));
    }
    pub fn eql(self: TableAdapter, a: Cache.Path, b: Cache.Path, b_index: usize) bool {
        _ = self;
        _ = b_index;
        return a.eql(b);
    }
}