structstd.hash_map.StringIndexContext[src]

Fields

bytes: *const std.ArrayListUnmanaged(u8)

Functions

Functioneql[src]

pub fn eql(_: @This(), a: u32, b: u32) bool

Parameters

_: @This()
a: u32
b: u32

Source Code

Source code
pub fn eql(_: @This(), a: u32, b: u32) bool {
    return a == b;
}

Functionhash[src]

pub fn hash(ctx: @This(), key: u32) u64

Parameters

ctx: @This()
key: u32

Source Code

Source code
pub fn hash(ctx: @This(), key: u32) u64 {
    return hashString(mem.sliceTo(ctx.bytes.items[key..], 0));
}

Source Code

Source code
pub const StringIndexContext = struct {
    bytes: *const std.ArrayListUnmanaged(u8),

    pub fn eql(_: @This(), a: u32, b: u32) bool {
        return a == b;
    }

    pub fn hash(ctx: @This(), key: u32) u64 {
        return hashString(mem.sliceTo(ctx.bytes.items[key..], 0));
    }
}