struct TableAdapter [src]

Useful to make Path a key in std.ArrayHashMap.

Members

Source

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.fd))) { .pointer => @intFromPtr(a.root_dir.handle.fd), .int => @as(u32, @bitCast(a.root_dir.handle.fd)), 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); } }