struct StringIndexAdapter [src]

Fields

bytes: *const std.ArrayListUnmanaged(u8)

Members

Source

pub const StringIndexAdapter = struct { bytes: *const std.ArrayListUnmanaged(u8), pub fn eql(ctx: @This(), a: []const u8, b: u32) bool { return mem.eql(u8, a, mem.sliceTo(ctx.bytes.items[b..], 0)); } pub fn hash(_: @This(), adapted_key: []const u8) u64 { assert(mem.indexOfScalar(u8, adapted_key, 0) == null); return hashString(adapted_key); } }