Documentation
¶
Index ¶
- type Iterator
- type Map
- func (m *Map) All(yield func(k, v unsafe.Pointer) bool)
- func (m *Map) Clear()
- func (m *Map) Delete(key unsafe.Pointer)
- func (m *Map) Get(key unsafe.Pointer) unsafe.Pointer
- func (m *Map) Iter() Iterator
- func (m *Map) Keys(yield func(k unsafe.Pointer) bool)
- func (m *Map) Len() int
- func (m *Map) Set(key, value unsafe.Pointer)
- func (m *Map) Values(yield func(v unsafe.Pointer) bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator provides iteration over map key-value pairs.
func (*Iterator) InitAny ¶
InitAny initializes the iterator for any map value. It panics if m is not a map.
func (*Iterator) InitReflectTypePtr ¶
InitReflectTypePtr initializes the iterator for a map given its type and pointer. It panics if mapType is not a map type.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map provides map operations for an unsafe.Pointer to a map.
func NewFromAny ¶
NewFromAny creates a Map from any map value. It panics if m is not a map.
func NewFromTypeAndPointer ¶
NewFromTypeAndPointer creates a Map from a map type and unsafe.Pointer to the map. It panics if mapType is not a map type.
func NewFromValue ¶
NewFromValue creates a Map from a reflect.Value. It panics if m is not a map.
func (*Map) Get ¶
Get returns a pointer to the value associated with key, or nil if the key is not present. The returned pointer points directly into the map and is only valid until the map is modified. Retaining this pointer may prevent the whole map from being garbage-collected.