Documentation
¶
Index ¶
- type Pair
- type RWMap
- func (r *RWMap[K, V]) Delete(key K)
- func (r *RWMap[K, V]) Iter() <-chan Pair[K, V]
- func (r *RWMap[K, V]) Keys() (keys []K)
- func (r *RWMap[K, V]) Len() (l int)
- func (r *RWMap[K, V]) Load(key K) (value V, ok bool)
- func (r *RWMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (r *RWMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (r *RWMap[K, V]) Range(f func(key K, value V) bool)
- func (r *RWMap[K, V]) Store(key K, value V)
- func (r *RWMap[K, V]) ToMap() map[K]V
- func (r *RWMap[K, V]) Values() (values []V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pair ¶
type Pair[K comparable, V any] struct { Key K Val V }
type Pair[K comparable, V any] = mapex.Pair[K comparable, V any]
type RWMap ¶
type RWMap[K comparable, V any] struct { // contains filtered or unexported fields }
func (*RWMap[K, V]) LoadAndDelete ¶
获取值,然后并删除
func (*RWMap[K, V]) LoadOrStore ¶
存在返回现有的值,loaded 为true 不存在就保存现在的值,loaded为false
Click to show internal directories.
Click to hide internal directories.