BufMap copies keys and values before they go into the map and frees them when they get removed.
Functions
fn deinit(self: *BufMap) void
Free the backing storage of the map, as well as all of the stored keys and valu…
Free the backing storage of the map, as well as all of the stored keys and values.
fn get(self: BufMap, key: []const u8) ?[]const u8
Return the map’s copy of the value associated with a key. The returned string …
Return the map’s copy of the value associated with a key. The returned string is invalidated if this key is removed from the map.
fn getPtr(self: BufMap, key: []const u8) ?*[]const u8
Find the address of the value associated with a key. The returned pointer is in…
Find the address of the value associated with a key. The returned pointer is invalidated if the map resizes.
fn init(allocator: Allocator) BufMap
Create a BufMap backed by a specific allocator. That allocator will be used for…
Create a BufMap backed by a specific allocator. That allocator will be used for both backing allocations and string deduplication.
fn put(self: *BufMap, key: []const u8, value: []const u8) !void
key
andvalue
are copied into the BufMap.