Documentation ¶
Index ¶
- type Safe
- func (s *Safe[K, V]) Each(cb func(a V) bool)
- func (s *Safe[K, V]) Exists(x K) bool
- func (s *Safe[K, V]) First() *V
- func (s *Safe[K, V]) Get(x K) *V
- func (s *Safe[K, V]) Last() *V
- func (s *Safe[K, V]) MarshalJSON() ([]byte, error)
- func (s *Safe[K, V]) PushEnd(x V)
- func (s *Safe[K, V]) PushStart(x V)
- func (s *Safe[K, V]) Remove(x K)
- func (s *Safe[K, V]) RemoveFirst() (x *V)
- func (s *Safe[K, V]) RemoveLast() (x *V)
- func (s *Safe[K, V]) Reset()
- func (s *Safe[K, V]) Size() int
- func (s *Safe[K, V]) UnmarshalJSON(data []byte) error
- type Set
- type Unsafe
- func (u *Unsafe[K, V]) Each(cb func(a V) bool)
- func (u *Unsafe[K, V]) Exists(x K) bool
- func (u *Unsafe[K, V]) First() *V
- func (u *Unsafe[K, V]) Get(x K) *V
- func (u *Unsafe[K, V]) Last() *V
- func (u *Unsafe[K, V]) MarshalJSON() ([]byte, error)
- func (u *Unsafe[K, V]) PushEnd(x V)
- func (u *Unsafe[K, V]) PushStart(x V)
- func (u *Unsafe[K, V]) Remove(x K)
- func (u *Unsafe[K, V]) RemoveFirst() (x *V)
- func (u *Unsafe[K, V]) RemoveLast() (x *V)
- func (u *Unsafe[K, V]) Reset()
- func (u *Unsafe[K, V]) Size() int
- func (u *Unsafe[K, V]) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Safe ¶
type Safe[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Safe[K, V]) MarshalJSON ¶
func (*Safe[K, V]) RemoveFirst ¶
func (s *Safe[K, V]) RemoveFirst() (x *V)
func (*Safe[K, V]) RemoveLast ¶
func (s *Safe[K, V]) RemoveLast() (x *V)
func (*Safe[K, V]) UnmarshalJSON ¶
type Set ¶
type Set[K comparable, V any] interface { PushStart(x V) PushEnd(x V) Size() int RemoveFirst() (x *V) RemoveLast() (x *V) Remove(x K) Exists(x K) bool Get(x K) *V First() *V Last() *V Each(cb func(a V) bool) Reset() UnmarshalJSON(data []byte) error MarshalJSON() ([]byte, error) }
func NewCustomSet ¶
func NewCustomSet[K comparable, V any](handler getKeyFunc[K, V]) Set[K, V]
func NewLimitedCustomSet ¶
func NewLimitedCustomSet[K comparable, V any](handler getKeyFunc[K, V], limit int) Set[K, V]
type Unsafe ¶
type Unsafe[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Unsafe[K, V]) MarshalJSON ¶
func (*Unsafe[K, V]) RemoveFirst ¶
func (u *Unsafe[K, V]) RemoveFirst() (x *V)
func (*Unsafe[K, V]) RemoveLast ¶
func (u *Unsafe[K, V]) RemoveLast() (x *V)
func (*Unsafe[K, V]) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.