Documentation ¶
Index ¶
- type Hashable
- type Hashmap
- func (hm *Hashmap[K, V]) Delete(key K)
- func (hm *Hashmap[K, V]) ForEach(f func(key K, value V))
- func (hm *Hashmap[K, V]) Free()
- func (hm *Hashmap[K, V]) Get(key K) (value V, exists bool)
- func (hm *Hashmap[K, V]) GetPtr(key K) (value *V, exists bool)
- func (hm *Hashmap[K, V]) Insert(key K, value V)
- func (hm *Hashmap[K, V]) Keys() []K
- func (hm *Hashmap[K, V]) Values() []V
- type Int
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hashable ¶
type Hashable interface { comparable Hash() uint32 }
Hashable keys must implement this interface or use type hashmap.String and hashmap.Int which implements the interface
type Hashmap ¶
Hashmap Manually managed hashmap, keys can be hashmap.String, hashmap.Int or any type that implements the hashmap.Hashable interface
func (*Hashmap[K, V]) Delete ¶ added in v0.7.0
func (hm *Hashmap[K, V]) Delete(key K)
Delete delete value with key K
func (*Hashmap[K, V]) ForEach ¶ added in v0.7.0
func (hm *Hashmap[K, V]) ForEach(f func(key K, value V))
ForEach iterates through all key/value pairs
func (*Hashmap[K, V]) Insert ¶
func (hm *Hashmap[K, V]) Insert(key K, value V)
Insert inserts a new value V if key K doesn't exist, Otherwise update the key K with value V
Click to show internal directories.
Click to hide internal directories.