Documentation ¶
Overview ¶
Package skipmap is a high-performance, scalable, concurrent-safe map based on skip-list. In the typical pattern(100000 operations, 90%LOAD 9%STORE 1%DELETE, 8C16T), the skipmap up to 10x faster than the built-in sync.Map.
Index ¶
- type FuncMap
- func NewFloat32[valueT any]() *FuncMap[float32, valueT]
- func NewFloat32Desc[valueT any]() *FuncMap[float32, valueT]
- func NewFloat64[valueT any]() *FuncMap[float64, valueT]
- func NewFloat64Desc[valueT any]() *FuncMap[float64, valueT]
- func NewFunc[keyT any, valueT any](less func(a, b keyT) bool) *FuncMap[keyT, valueT]
- func (s *FuncMap[keyT, valueT]) Delete(key keyT) bool
- func (s *FuncMap[keyT, valueT]) Len() int
- func (s *FuncMap[keyT, valueT]) Load(key keyT) (value valueT, ok bool)
- func (s *FuncMap[keyT, valueT]) LoadAndDelete(key keyT) (value valueT, loaded bool)
- func (s *FuncMap[keyT, valueT]) LoadOrStore(key keyT, value valueT) (actual valueT, loaded bool)
- func (s *FuncMap[keyT, valueT]) LoadOrStoreLazy(key keyT, f func() valueT) (actual valueT, loaded bool)
- func (s *FuncMap[keyT, valueT]) Range(f func(key keyT, value valueT) bool)
- func (s *FuncMap[keyT, valueT]) Store(key keyT, value valueT)
- type Int32Map
- func (s *Int32Map[valueT]) Delete(key int32) bool
- func (s *Int32Map[valueT]) Len() int
- func (s *Int32Map[valueT]) Load(key int32) (value valueT, ok bool)
- func (s *Int32Map[valueT]) LoadAndDelete(key int32) (value valueT, loaded bool)
- func (s *Int32Map[valueT]) LoadOrStore(key int32, value valueT) (actual valueT, loaded bool)
- func (s *Int32Map[valueT]) LoadOrStoreLazy(key int32, f func() valueT) (actual valueT, loaded bool)
- func (s *Int32Map[valueT]) Range(f func(key int32, value valueT) bool)
- func (s *Int32Map[valueT]) Store(key int32, value valueT)
- type Int32MapDesc
- func (s *Int32MapDesc[valueT]) Delete(key int32) bool
- func (s *Int32MapDesc[valueT]) Len() int
- func (s *Int32MapDesc[valueT]) Load(key int32) (value valueT, ok bool)
- func (s *Int32MapDesc[valueT]) LoadAndDelete(key int32) (value valueT, loaded bool)
- func (s *Int32MapDesc[valueT]) LoadOrStore(key int32, value valueT) (actual valueT, loaded bool)
- func (s *Int32MapDesc[valueT]) LoadOrStoreLazy(key int32, f func() valueT) (actual valueT, loaded bool)
- func (s *Int32MapDesc[valueT]) Range(f func(key int32, value valueT) bool)
- func (s *Int32MapDesc[valueT]) Store(key int32, value valueT)
- type Int64Map
- func (s *Int64Map[valueT]) Delete(key int64) bool
- func (s *Int64Map[valueT]) Len() int
- func (s *Int64Map[valueT]) Load(key int64) (value valueT, ok bool)
- func (s *Int64Map[valueT]) LoadAndDelete(key int64) (value valueT, loaded bool)
- func (s *Int64Map[valueT]) LoadOrStore(key int64, value valueT) (actual valueT, loaded bool)
- func (s *Int64Map[valueT]) LoadOrStoreLazy(key int64, f func() valueT) (actual valueT, loaded bool)
- func (s *Int64Map[valueT]) Range(f func(key int64, value valueT) bool)
- func (s *Int64Map[valueT]) Store(key int64, value valueT)
- type Int64MapDesc
- func (s *Int64MapDesc[valueT]) Delete(key int64) bool
- func (s *Int64MapDesc[valueT]) Len() int
- func (s *Int64MapDesc[valueT]) Load(key int64) (value valueT, ok bool)
- func (s *Int64MapDesc[valueT]) LoadAndDelete(key int64) (value valueT, loaded bool)
- func (s *Int64MapDesc[valueT]) LoadOrStore(key int64, value valueT) (actual valueT, loaded bool)
- func (s *Int64MapDesc[valueT]) LoadOrStoreLazy(key int64, f func() valueT) (actual valueT, loaded bool)
- func (s *Int64MapDesc[valueT]) Range(f func(key int64, value valueT) bool)
- func (s *Int64MapDesc[valueT]) Store(key int64, value valueT)
- type IntMap
- func (s *IntMap[valueT]) Delete(key int) bool
- func (s *IntMap[valueT]) Len() int
- func (s *IntMap[valueT]) Load(key int) (value valueT, ok bool)
- func (s *IntMap[valueT]) LoadAndDelete(key int) (value valueT, loaded bool)
- func (s *IntMap[valueT]) LoadOrStore(key int, value valueT) (actual valueT, loaded bool)
- func (s *IntMap[valueT]) LoadOrStoreLazy(key int, f func() valueT) (actual valueT, loaded bool)
- func (s *IntMap[valueT]) Range(f func(key int, value valueT) bool)
- func (s *IntMap[valueT]) Store(key int, value valueT)
- type IntMapDesc
- func (s *IntMapDesc[valueT]) Delete(key int) bool
- func (s *IntMapDesc[valueT]) Len() int
- func (s *IntMapDesc[valueT]) Load(key int) (value valueT, ok bool)
- func (s *IntMapDesc[valueT]) LoadAndDelete(key int) (value valueT, loaded bool)
- func (s *IntMapDesc[valueT]) LoadOrStore(key int, value valueT) (actual valueT, loaded bool)
- func (s *IntMapDesc[valueT]) LoadOrStoreLazy(key int, f func() valueT) (actual valueT, loaded bool)
- func (s *IntMapDesc[valueT]) Range(f func(key int, value valueT) bool)
- func (s *IntMapDesc[valueT]) Store(key int, value valueT)
- type OrderedMap
- func (s *OrderedMap[keyT, valueT]) Delete(key keyT) bool
- func (s *OrderedMap[keyT, valueT]) Len() int
- func (s *OrderedMap[keyT, valueT]) Load(key keyT) (value valueT, ok bool)
- func (s *OrderedMap[keyT, valueT]) LoadAndDelete(key keyT) (value valueT, loaded bool)
- func (s *OrderedMap[keyT, valueT]) LoadOrStore(key keyT, value valueT) (actual valueT, loaded bool)
- func (s *OrderedMap[keyT, valueT]) LoadOrStoreLazy(key keyT, f func() valueT) (actual valueT, loaded bool)
- func (s *OrderedMap[keyT, valueT]) Range(f func(key keyT, value valueT) bool)
- func (s *OrderedMap[keyT, valueT]) Store(key keyT, value valueT)
- type OrderedMapDesc
- func (s *OrderedMapDesc[keyT, valueT]) Delete(key keyT) bool
- func (s *OrderedMapDesc[keyT, valueT]) Len() int
- func (s *OrderedMapDesc[keyT, valueT]) Load(key keyT) (value valueT, ok bool)
- func (s *OrderedMapDesc[keyT, valueT]) LoadAndDelete(key keyT) (value valueT, loaded bool)
- func (s *OrderedMapDesc[keyT, valueT]) LoadOrStore(key keyT, value valueT) (actual valueT, loaded bool)
- func (s *OrderedMapDesc[keyT, valueT]) LoadOrStoreLazy(key keyT, f func() valueT) (actual valueT, loaded bool)
- func (s *OrderedMapDesc[keyT, valueT]) Range(f func(key keyT, value valueT) bool)
- func (s *OrderedMapDesc[keyT, valueT]) Store(key keyT, value valueT)
- type StringMap
- func (s *StringMap[valueT]) Delete(key string) bool
- func (s *StringMap[valueT]) Len() int
- func (s *StringMap[valueT]) Load(key string) (value valueT, ok bool)
- func (s *StringMap[valueT]) LoadAndDelete(key string) (value valueT, loaded bool)
- func (s *StringMap[valueT]) LoadOrStore(key string, value valueT) (actual valueT, loaded bool)
- func (s *StringMap[valueT]) LoadOrStoreLazy(key string, f func() valueT) (actual valueT, loaded bool)
- func (s *StringMap[valueT]) Range(f func(key string, value valueT) bool)
- func (s *StringMap[valueT]) Store(key string, value valueT)
- type StringMapDesc
- func (s *StringMapDesc[valueT]) Delete(key string) bool
- func (s *StringMapDesc[valueT]) Len() int
- func (s *StringMapDesc[valueT]) Load(key string) (value valueT, ok bool)
- func (s *StringMapDesc[valueT]) LoadAndDelete(key string) (value valueT, loaded bool)
- func (s *StringMapDesc[valueT]) LoadOrStore(key string, value valueT) (actual valueT, loaded bool)
- func (s *StringMapDesc[valueT]) LoadOrStoreLazy(key string, f func() valueT) (actual valueT, loaded bool)
- func (s *StringMapDesc[valueT]) Range(f func(key string, value valueT) bool)
- func (s *StringMapDesc[valueT]) Store(key string, value valueT)
- type Uint32Map
- func (s *Uint32Map[valueT]) Delete(key uint32) bool
- func (s *Uint32Map[valueT]) Len() int
- func (s *Uint32Map[valueT]) Load(key uint32) (value valueT, ok bool)
- func (s *Uint32Map[valueT]) LoadAndDelete(key uint32) (value valueT, loaded bool)
- func (s *Uint32Map[valueT]) LoadOrStore(key uint32, value valueT) (actual valueT, loaded bool)
- func (s *Uint32Map[valueT]) LoadOrStoreLazy(key uint32, f func() valueT) (actual valueT, loaded bool)
- func (s *Uint32Map[valueT]) Range(f func(key uint32, value valueT) bool)
- func (s *Uint32Map[valueT]) Store(key uint32, value valueT)
- type Uint32MapDesc
- func (s *Uint32MapDesc[valueT]) Delete(key uint32) bool
- func (s *Uint32MapDesc[valueT]) Len() int
- func (s *Uint32MapDesc[valueT]) Load(key uint32) (value valueT, ok bool)
- func (s *Uint32MapDesc[valueT]) LoadAndDelete(key uint32) (value valueT, loaded bool)
- func (s *Uint32MapDesc[valueT]) LoadOrStore(key uint32, value valueT) (actual valueT, loaded bool)
- func (s *Uint32MapDesc[valueT]) LoadOrStoreLazy(key uint32, f func() valueT) (actual valueT, loaded bool)
- func (s *Uint32MapDesc[valueT]) Range(f func(key uint32, value valueT) bool)
- func (s *Uint32MapDesc[valueT]) Store(key uint32, value valueT)
- type Uint64Map
- func (s *Uint64Map[valueT]) Delete(key uint64) bool
- func (s *Uint64Map[valueT]) Len() int
- func (s *Uint64Map[valueT]) Load(key uint64) (value valueT, ok bool)
- func (s *Uint64Map[valueT]) LoadAndDelete(key uint64) (value valueT, loaded bool)
- func (s *Uint64Map[valueT]) LoadOrStore(key uint64, value valueT) (actual valueT, loaded bool)
- func (s *Uint64Map[valueT]) LoadOrStoreLazy(key uint64, f func() valueT) (actual valueT, loaded bool)
- func (s *Uint64Map[valueT]) Range(f func(key uint64, value valueT) bool)
- func (s *Uint64Map[valueT]) Store(key uint64, value valueT)
- type Uint64MapDesc
- func (s *Uint64MapDesc[valueT]) Delete(key uint64) bool
- func (s *Uint64MapDesc[valueT]) Len() int
- func (s *Uint64MapDesc[valueT]) Load(key uint64) (value valueT, ok bool)
- func (s *Uint64MapDesc[valueT]) LoadAndDelete(key uint64) (value valueT, loaded bool)
- func (s *Uint64MapDesc[valueT]) LoadOrStore(key uint64, value valueT) (actual valueT, loaded bool)
- func (s *Uint64MapDesc[valueT]) LoadOrStoreLazy(key uint64, f func() valueT) (actual valueT, loaded bool)
- func (s *Uint64MapDesc[valueT]) Range(f func(key uint64, value valueT) bool)
- func (s *Uint64MapDesc[valueT]) Store(key uint64, value valueT)
- type UintMap
- func (s *UintMap[valueT]) Delete(key uint) bool
- func (s *UintMap[valueT]) Len() int
- func (s *UintMap[valueT]) Load(key uint) (value valueT, ok bool)
- func (s *UintMap[valueT]) LoadAndDelete(key uint) (value valueT, loaded bool)
- func (s *UintMap[valueT]) LoadOrStore(key uint, value valueT) (actual valueT, loaded bool)
- func (s *UintMap[valueT]) LoadOrStoreLazy(key uint, f func() valueT) (actual valueT, loaded bool)
- func (s *UintMap[valueT]) Range(f func(key uint, value valueT) bool)
- func (s *UintMap[valueT]) Store(key uint, value valueT)
- type UintMapDesc
- func (s *UintMapDesc[valueT]) Delete(key uint) bool
- func (s *UintMapDesc[valueT]) Len() int
- func (s *UintMapDesc[valueT]) Load(key uint) (value valueT, ok bool)
- func (s *UintMapDesc[valueT]) LoadAndDelete(key uint) (value valueT, loaded bool)
- func (s *UintMapDesc[valueT]) LoadOrStore(key uint, value valueT) (actual valueT, loaded bool)
- func (s *UintMapDesc[valueT]) LoadOrStoreLazy(key uint, f func() valueT) (actual valueT, loaded bool)
- func (s *UintMapDesc[valueT]) Range(f func(key uint, value valueT) bool)
- func (s *UintMapDesc[valueT]) Store(key uint, value valueT)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncMap ¶ added in v0.8.0
FuncMap represents a map based on skip list.
func NewFloat32 ¶
NewFloat32 returns an empty skipmap in ascending order.
func NewFloat32Desc ¶ added in v0.3.0
NewFloat32Desc returns an empty skipmap in descending order.
func NewFloat64 ¶
NewFloat64 returns an empty skipmap in ascending order.
func NewFloat64Desc ¶ added in v0.3.0
NewFloat64Desc returns an empty skipmap in descending order.
func NewFunc ¶ added in v0.8.0
NewFunc returns an empty skipmap in ascending order.
Note that the less function requires a strict weak ordering, see https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings, or undefined behavior will happen.
func (*FuncMap[keyT, valueT]) Load ¶ added in v0.8.0
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*FuncMap[keyT, valueT]) LoadAndDelete ¶ added in v0.8.0
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*FuncMap[keyT, valueT]) LoadOrStore ¶ added in v0.8.0
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*FuncMap[keyT, valueT]) LoadOrStoreLazy ¶ added in v0.8.0
func (s *FuncMap[keyT, valueT]) LoadOrStoreLazy(key keyT, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*FuncMap[keyT, valueT]) Range ¶ added in v0.8.0
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type Int32Map ¶
type Int32Map[valueT any] struct { // contains filtered or unexported fields }
Int32Map represents a map based on skip list.
func (*Int32Map[valueT]) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Int32Map[valueT]) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Int32Map[valueT]) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Int32Map[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Int32Map[valueT]) Range ¶
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type Int32MapDesc ¶ added in v0.3.0
type Int32MapDesc[valueT any] struct { // contains filtered or unexported fields }
Int32MapDesc represents a map based on skip list.
func NewInt32Desc ¶ added in v0.3.0
func NewInt32Desc[valueT any]() *Int32MapDesc[valueT]
NewInt32Desc returns an empty skipmap in descending order.
func (*Int32MapDesc[valueT]) Delete ¶ added in v0.3.0
func (s *Int32MapDesc[valueT]) Delete(key int32) bool
Delete deletes the value for a key.
func (*Int32MapDesc[valueT]) Len ¶ added in v0.3.0
func (s *Int32MapDesc[valueT]) Len() int
Len returns the length of this skipmap.
func (*Int32MapDesc[valueT]) Load ¶ added in v0.3.0
func (s *Int32MapDesc[valueT]) Load(key int32) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Int32MapDesc[valueT]) LoadAndDelete ¶ added in v0.3.0
func (s *Int32MapDesc[valueT]) LoadAndDelete(key int32) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Int32MapDesc[valueT]) LoadOrStore ¶ added in v0.3.0
func (s *Int32MapDesc[valueT]) LoadOrStore(key int32, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Int32MapDesc[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *Int32MapDesc[valueT]) LoadOrStoreLazy(key int32, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Int32MapDesc[valueT]) Range ¶ added in v0.3.0
func (s *Int32MapDesc[valueT]) Range(f func(key int32, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*Int32MapDesc[valueT]) Store ¶ added in v0.3.0
func (s *Int32MapDesc[valueT]) Store(key int32, value valueT)
Store sets the value for a key.
type Int64Map ¶
type Int64Map[valueT any] struct { // contains filtered or unexported fields }
Int64Map represents a map based on skip list.
func (*Int64Map[valueT]) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Int64Map[valueT]) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Int64Map[valueT]) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Int64Map[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Int64Map[valueT]) Range ¶
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type Int64MapDesc ¶ added in v0.3.0
type Int64MapDesc[valueT any] struct { // contains filtered or unexported fields }
Int64MapDesc represents a map based on skip list.
func NewInt64Desc ¶ added in v0.3.0
func NewInt64Desc[valueT any]() *Int64MapDesc[valueT]
NewInt64Desc returns an empty skipmap in descending order.
func (*Int64MapDesc[valueT]) Delete ¶ added in v0.3.0
func (s *Int64MapDesc[valueT]) Delete(key int64) bool
Delete deletes the value for a key.
func (*Int64MapDesc[valueT]) Len ¶ added in v0.3.0
func (s *Int64MapDesc[valueT]) Len() int
Len returns the length of this skipmap.
func (*Int64MapDesc[valueT]) Load ¶ added in v0.3.0
func (s *Int64MapDesc[valueT]) Load(key int64) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Int64MapDesc[valueT]) LoadAndDelete ¶ added in v0.3.0
func (s *Int64MapDesc[valueT]) LoadAndDelete(key int64) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Int64MapDesc[valueT]) LoadOrStore ¶ added in v0.3.0
func (s *Int64MapDesc[valueT]) LoadOrStore(key int64, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Int64MapDesc[valueT]) LoadOrStoreLazy ¶ added in v0.8.0
func (s *Int64MapDesc[valueT]) LoadOrStoreLazy(key int64, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Int64MapDesc[valueT]) Range ¶ added in v0.3.0
func (s *Int64MapDesc[valueT]) Range(f func(key int64, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*Int64MapDesc[valueT]) Store ¶ added in v0.3.0
func (s *Int64MapDesc[valueT]) Store(key int64, value valueT)
Store sets the value for a key.
type IntMap ¶
type IntMap[valueT any] struct { // contains filtered or unexported fields }
IntMap represents a map based on skip list.
func (*IntMap[valueT]) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*IntMap[valueT]) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*IntMap[valueT]) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*IntMap[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*IntMap[valueT]) Range ¶
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type IntMapDesc ¶ added in v0.3.0
type IntMapDesc[valueT any] struct { // contains filtered or unexported fields }
IntMapDesc represents a map based on skip list.
func NewIntDesc ¶ added in v0.3.0
func NewIntDesc[valueT any]() *IntMapDesc[valueT]
NewIntDesc returns an empty skipmap in descending order.
func (*IntMapDesc[valueT]) Delete ¶ added in v0.3.0
func (s *IntMapDesc[valueT]) Delete(key int) bool
Delete deletes the value for a key.
func (*IntMapDesc[valueT]) Len ¶ added in v0.3.0
func (s *IntMapDesc[valueT]) Len() int
Len returns the length of this skipmap.
func (*IntMapDesc[valueT]) Load ¶ added in v0.3.0
func (s *IntMapDesc[valueT]) Load(key int) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*IntMapDesc[valueT]) LoadAndDelete ¶ added in v0.3.0
func (s *IntMapDesc[valueT]) LoadAndDelete(key int) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*IntMapDesc[valueT]) LoadOrStore ¶ added in v0.3.0
func (s *IntMapDesc[valueT]) LoadOrStore(key int, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*IntMapDesc[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *IntMapDesc[valueT]) LoadOrStoreLazy(key int, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*IntMapDesc[valueT]) Range ¶ added in v0.3.0
func (s *IntMapDesc[valueT]) Range(f func(key int, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*IntMapDesc[valueT]) Store ¶ added in v0.3.0
func (s *IntMapDesc[valueT]) Store(key int, value valueT)
Store sets the value for a key.
type OrderedMap ¶ added in v0.8.0
type OrderedMap[keyT ordered, valueT any] struct { // contains filtered or unexported fields }
OrderedMap represents a map based on skip list.
func New ¶ added in v0.8.0
func New[keyT ordered, valueT any]() *OrderedMap[keyT, valueT]
New returns an empty skipmap in ascending order.
func (*OrderedMap[keyT, valueT]) Delete ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) Delete(key keyT) bool
Delete deletes the value for a key.
func (*OrderedMap[keyT, valueT]) Len ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) Len() int
Len returns the length of this skipmap.
func (*OrderedMap[keyT, valueT]) Load ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) Load(key keyT) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*OrderedMap[keyT, valueT]) LoadAndDelete ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) LoadAndDelete(key keyT) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*OrderedMap[keyT, valueT]) LoadOrStore ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) LoadOrStore(key keyT, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*OrderedMap[keyT, valueT]) LoadOrStoreLazy ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) LoadOrStoreLazy(key keyT, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*OrderedMap[keyT, valueT]) Range ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) Range(f func(key keyT, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*OrderedMap[keyT, valueT]) Store ¶ added in v0.8.0
func (s *OrderedMap[keyT, valueT]) Store(key keyT, value valueT)
Store sets the value for a key.
type OrderedMapDesc ¶ added in v0.8.0
type OrderedMapDesc[keyT ordered, valueT any] struct { // contains filtered or unexported fields }
OrderedMapDesc represents a map based on skip list.
func NewDesc ¶ added in v0.8.0
func NewDesc[keyT ordered, valueT any]() *OrderedMapDesc[keyT, valueT]
NewDesc returns an empty skipmap in descending order.
func (*OrderedMapDesc[keyT, valueT]) Delete ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) Delete(key keyT) bool
Delete deletes the value for a key.
func (*OrderedMapDesc[keyT, valueT]) Len ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) Len() int
Len returns the length of this skipmap.
func (*OrderedMapDesc[keyT, valueT]) Load ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) Load(key keyT) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*OrderedMapDesc[keyT, valueT]) LoadAndDelete ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) LoadAndDelete(key keyT) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*OrderedMapDesc[keyT, valueT]) LoadOrStore ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) LoadOrStore(key keyT, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*OrderedMapDesc[keyT, valueT]) LoadOrStoreLazy ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) LoadOrStoreLazy(key keyT, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*OrderedMapDesc[keyT, valueT]) Range ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) Range(f func(key keyT, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*OrderedMapDesc[keyT, valueT]) Store ¶ added in v0.8.0
func (s *OrderedMapDesc[keyT, valueT]) Store(key keyT, value valueT)
Store sets the value for a key.
type StringMap ¶
type StringMap[valueT any] struct { // contains filtered or unexported fields }
StringMap represents a map based on skip list.
func (*StringMap[valueT]) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*StringMap[valueT]) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*StringMap[valueT]) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*StringMap[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *StringMap[valueT]) LoadOrStoreLazy(key string, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*StringMap[valueT]) Range ¶
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type StringMapDesc ¶ added in v0.8.0
type StringMapDesc[valueT any] struct { // contains filtered or unexported fields }
StringMapDesc represents a map based on skip list.
func NewStringDesc ¶ added in v0.8.0
func NewStringDesc[valueT any]() *StringMapDesc[valueT]
NewStringDesc returns an empty skipmap in descending order.
func (*StringMapDesc[valueT]) Delete ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) Delete(key string) bool
Delete deletes the value for a key.
func (*StringMapDesc[valueT]) Len ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) Len() int
Len returns the length of this skipmap.
func (*StringMapDesc[valueT]) Load ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) Load(key string) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*StringMapDesc[valueT]) LoadAndDelete ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) LoadAndDelete(key string) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*StringMapDesc[valueT]) LoadOrStore ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) LoadOrStore(key string, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*StringMapDesc[valueT]) LoadOrStoreLazy ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) LoadOrStoreLazy(key string, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*StringMapDesc[valueT]) Range ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) Range(f func(key string, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*StringMapDesc[valueT]) Store ¶ added in v0.8.0
func (s *StringMapDesc[valueT]) Store(key string, value valueT)
Store sets the value for a key.
type Uint32Map ¶
type Uint32Map[valueT any] struct { // contains filtered or unexported fields }
Uint32Map represents a map based on skip list.
func (*Uint32Map[valueT]) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Uint32Map[valueT]) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Uint32Map[valueT]) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Uint32Map[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *Uint32Map[valueT]) LoadOrStoreLazy(key uint32, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Uint32Map[valueT]) Range ¶
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type Uint32MapDesc ¶ added in v0.3.0
type Uint32MapDesc[valueT any] struct { // contains filtered or unexported fields }
Uint32MapDesc represents a map based on skip list.
func NewUint32Desc ¶ added in v0.3.0
func NewUint32Desc[valueT any]() *Uint32MapDesc[valueT]
NewUint32Desc returns an empty skipmap in descending order.
func (*Uint32MapDesc[valueT]) Delete ¶ added in v0.3.0
func (s *Uint32MapDesc[valueT]) Delete(key uint32) bool
Delete deletes the value for a key.
func (*Uint32MapDesc[valueT]) Len ¶ added in v0.3.0
func (s *Uint32MapDesc[valueT]) Len() int
Len returns the length of this skipmap.
func (*Uint32MapDesc[valueT]) Load ¶ added in v0.3.0
func (s *Uint32MapDesc[valueT]) Load(key uint32) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Uint32MapDesc[valueT]) LoadAndDelete ¶ added in v0.3.0
func (s *Uint32MapDesc[valueT]) LoadAndDelete(key uint32) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Uint32MapDesc[valueT]) LoadOrStore ¶ added in v0.3.0
func (s *Uint32MapDesc[valueT]) LoadOrStore(key uint32, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Uint32MapDesc[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *Uint32MapDesc[valueT]) LoadOrStoreLazy(key uint32, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Uint32MapDesc[valueT]) Range ¶ added in v0.3.0
func (s *Uint32MapDesc[valueT]) Range(f func(key uint32, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*Uint32MapDesc[valueT]) Store ¶ added in v0.3.0
func (s *Uint32MapDesc[valueT]) Store(key uint32, value valueT)
Store sets the value for a key.
type Uint64Map ¶
type Uint64Map[valueT any] struct { // contains filtered or unexported fields }
Uint64Map represents a map based on skip list.
func (*Uint64Map[valueT]) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Uint64Map[valueT]) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Uint64Map[valueT]) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Uint64Map[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *Uint64Map[valueT]) LoadOrStoreLazy(key uint64, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Uint64Map[valueT]) Range ¶
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type Uint64MapDesc ¶ added in v0.3.0
type Uint64MapDesc[valueT any] struct { // contains filtered or unexported fields }
Uint64MapDesc represents a map based on skip list.
func NewUint64Desc ¶ added in v0.3.0
func NewUint64Desc[valueT any]() *Uint64MapDesc[valueT]
NewUint64Desc returns an empty skipmap in descending order.
func (*Uint64MapDesc[valueT]) Delete ¶ added in v0.3.0
func (s *Uint64MapDesc[valueT]) Delete(key uint64) bool
Delete deletes the value for a key.
func (*Uint64MapDesc[valueT]) Len ¶ added in v0.3.0
func (s *Uint64MapDesc[valueT]) Len() int
Len returns the length of this skipmap.
func (*Uint64MapDesc[valueT]) Load ¶ added in v0.3.0
func (s *Uint64MapDesc[valueT]) Load(key uint64) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Uint64MapDesc[valueT]) LoadAndDelete ¶ added in v0.3.0
func (s *Uint64MapDesc[valueT]) LoadAndDelete(key uint64) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*Uint64MapDesc[valueT]) LoadOrStore ¶ added in v0.3.0
func (s *Uint64MapDesc[valueT]) LoadOrStore(key uint64, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*Uint64MapDesc[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *Uint64MapDesc[valueT]) LoadOrStoreLazy(key uint64, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*Uint64MapDesc[valueT]) Range ¶ added in v0.3.0
func (s *Uint64MapDesc[valueT]) Range(f func(key uint64, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*Uint64MapDesc[valueT]) Store ¶ added in v0.3.0
func (s *Uint64MapDesc[valueT]) Store(key uint64, value valueT)
Store sets the value for a key.
type UintMap ¶
type UintMap[valueT any] struct { // contains filtered or unexported fields }
UintMap represents a map based on skip list.
func (*UintMap[valueT]) Load ¶
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*UintMap[valueT]) LoadAndDelete ¶
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*UintMap[valueT]) LoadOrStore ¶
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*UintMap[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*UintMap[valueT]) Range ¶
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
type UintMapDesc ¶ added in v0.3.0
type UintMapDesc[valueT any] struct { // contains filtered or unexported fields }
UintMapDesc represents a map based on skip list.
func NewUintDesc ¶ added in v0.3.0
func NewUintDesc[valueT any]() *UintMapDesc[valueT]
NewUintDesc returns an empty skipmap in descending order.
func (*UintMapDesc[valueT]) Delete ¶ added in v0.3.0
func (s *UintMapDesc[valueT]) Delete(key uint) bool
Delete deletes the value for a key.
func (*UintMapDesc[valueT]) Len ¶ added in v0.3.0
func (s *UintMapDesc[valueT]) Len() int
Len returns the length of this skipmap.
func (*UintMapDesc[valueT]) Load ¶ added in v0.3.0
func (s *UintMapDesc[valueT]) Load(key uint) (value valueT, ok bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*UintMapDesc[valueT]) LoadAndDelete ¶ added in v0.3.0
func (s *UintMapDesc[valueT]) LoadAndDelete(key uint) (value valueT, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present. (Modified from Delete)
func (*UintMapDesc[valueT]) LoadOrStore ¶ added in v0.3.0
func (s *UintMapDesc[valueT]) LoadOrStore(key uint, value valueT) (actual valueT, loaded bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored. (Modified from Store)
func (*UintMapDesc[valueT]) LoadOrStoreLazy ¶ added in v0.7.0
func (s *UintMapDesc[valueT]) LoadOrStoreLazy(key uint, f func() valueT) (actual valueT, loaded bool)
LoadOrStoreLazy returns the existing value for the key if present. Otherwise, it stores and returns the given value from f, f will only be called once. The loaded result is true if the value was loaded, false if stored. (Modified from LoadOrStore)
func (*UintMapDesc[valueT]) Range ¶ added in v0.3.0
func (s *UintMapDesc[valueT]) Range(f func(key uint, value valueT) bool)
Range calls f sequentially for each key and value present in the skipmap. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
func (*UintMapDesc[valueT]) Store ¶ added in v0.3.0
func (s *UintMapDesc[valueT]) Store(key uint, value valueT)
Store sets the value for a key.