Documentation
¶
Index ¶
- func LexicalRange[K cmp.Ordered, V any](sm Map[K, V]) iter.Seq2[K, V]
- type ActiveMap
- type LexicalMap
- type Map
- func (sm *Map[K, V]) AsMap() map[K]V
- func (sm *Map[K, V]) Clone() *Map[K, V]
- func (sm *Map[K, V]) Delete(k K) error
- func (sm *Map[K, V]) DeleteAt(i int)
- func (sm *Map[K, V]) Entries() iter.Seq2[K, V]
- func (sm *Map[K, V]) Get(k K) (V, bool)
- func (sm *Map[K, V]) GetAt(i int) V
- func (sm *Map[K, V]) Import(b *Map[K, V])
- func (sm *Map[K, V]) Incorporate(m map[K]V)
- func (sm *Map[K, V]) IndexOf(key K) int
- func (sm *Map[K, V]) Length() int
- func (sm *Map[K, V]) MarshalBinary() ([]byte, error)
- func (sm Map[K, V]) MarshalJSON() ([]byte, error)
- func (sm *Map[K, V]) Set(key K, val V) error
- func (sm *Map[K, V]) UnmarshalBinary(p []byte) error
- func (sm *Map[K, V]) UnmarshalJSON(b []byte) error
- func (sm *Map[K, V]) Unshift(key K, val V)
- type Maybe
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActiveMap ¶ added in v0.0.4
type ActiveMap[K comparable, V any] struct { *Map[K, V] // contains filtered or unexported fields }
ActiveMap is a Map that emits events when it mutates.
func NewActiveMap ¶ added in v0.0.4
func NewActiveMap[K comparable, V any]() *ActiveMap[K, V]
NewActiveMap instantiates a new ActiveMap
type LexicalMap ¶ added in v1.5.1
LexicalMap is a Map that cares about lexical order rather than insertion order.
func LexicalFrom ¶ added in v1.4.2
func LexicalFrom[K cmp.Ordered, V any](m map[K]V) *LexicalMap[K, V]
func NewLexicalMap ¶ added in v1.5.1
func NewLexicalMap[K cmp.Ordered, V any]() *LexicalMap[K, V]
func (*LexicalMap[K, V]) Entries ¶ added in v1.5.1
func (lm *LexicalMap[K, V]) Entries() iter.Seq2[K, V]
func (*LexicalMap[K, V]) MarshalBinary ¶ added in v1.5.1
func (lm *LexicalMap[K, V]) MarshalBinary() ([]byte, error)
type Map ¶ added in v1.5.1
type Map[K comparable, V any] struct { *sync.RWMutex // contains filtered or unexported fields }
Map is a map whose keys are ordered, and whose operations are concurrency safe and which marshals itself into predictable, deterministic bytes.
func From ¶ added in v0.0.3
func From[K comparable, V any](m map[K]V) *Map[K, V]
func New ¶
func New[K comparable, V any]() *Map[K, V]
func (*Map[K, V]) Entries ¶ added in v1.5.1
Entries provides a stable "range over" iteration, preserving insertion order.
func (*Map[K, V]) Get ¶ added in v1.5.1
Get gets a value and a boolean indicating if there actually was something there
func (*Map[K, V]) Incorporate ¶ added in v1.5.1
func (sm *Map[K, V]) Incorporate(m map[K]V)
Incorporate incorporates a map, merging it with existing entries
func (*Map[K, V]) MarshalBinary ¶ added in v1.5.1
func (Map[K, V]) MarshalJSON ¶ added in v1.5.1
func (*Map[K, V]) UnmarshalBinary ¶ added in v1.5.1
func (*Map[K, V]) UnmarshalJSON ¶ added in v1.5.1
Click to show internal directories.
Click to hide internal directories.