Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
NewGset Deprecated: 存储的元素类型为 interface{}.
@param safe 是否并发安全?
NewGsetFrom Deprecated: 存储的元素类型为 interface{}.
@param items (1) 切片实例(元素类型不限)
(2) 可以为nil
@param safe 是否并发安全?
Functions ¶
func NewSet ¶
func NewSet[T comparable](threadSafe bool, args ...T) mapset.Set[T]
NewSet
@param threadSafe 是否并发安全?
e.g.
set := setKit.NewSet[interface{}](false) // Add成功 fmt.Println(set.Add(1)) // true // Add失败 fmt.Println(set.Add(1)) // false
func NewSetFromMapKeys ¶
func NewSetFromMapKeys[T comparable, V any](threadSafe bool, val map[T]V) mapset.Set[T]
func NewSetWithSize ¶
func NewSetWithSize[T comparable](threadSafe bool, cardinality int) mapset.Set[T]
Types ¶
type SetWithLock ¶
type SetWithLock[T comparable] struct { mutexKit.RWMutex // Set 并发不安全的 Set mapset.Set[T] }
func NewSetWithLock ¶
func NewSetWithLock[T comparable]() *SetWithLock[T]
func (*SetWithLock[E]) Size ¶
func (set *SetWithLock[E]) Size() (size int)
Click to show internal directories.
Click to hide internal directories.