std1.0.0-beta-7 SafeC docs

std :: collections::map

Struct std::StrMap

#include <std/collections/map.h> source

generic<V> struct StrMap {
    ?&heap struct String keys;
    ?&heap V vals;
    ?&heap unsigned int hashes;
    ?&heap unsigned char states;
    unsigned long cap;
    unsigned long len;
    unsigned long tombstones;
}

Fields

§?&heap struct String keyssource

owned copies; valid while the slot is MAP_FULL_

§?&heap V valssource
§?&heap unsigned int hashessource
§?&heap unsigned char statessource
§unsigned long capsource
§unsigned long lensource
§unsigned long tombstonessource

Methods

§static struct StrMap<V> new()source · definition

empty, no allocation

§int insert(const &char key, V val)source · definition

copies key; 0 on OOM

§?&V get(const &char key) constsource · definition
§int contains(const &char key) constsource · definition
§?V remove(const &char key)source · definition
§unsigned long length() constsource · definition
§int is_empty() constsource · definition
§void clear()source · definition
§void foreach(fn void(const &char, &V) func)source · definition
§void drop()source · definition
§void free() consumesource · definition

= drop()