Documentation
¶
Index ¶
- type Map
- func (m *Map[A, B]) Delete(a A) (change bool)
- func (m *Map[A, B]) DeleteFar(b B) (change bool)
- func (m *Map[A, B]) Get(a A) (b B, has bool)
- func (m *Map[A, B]) GetFar(b B) (a A, has bool)
- func (m *Map[A, B]) Invert() (out *Map[B, A])
- func (m *Map[A, B]) Iter() (it iter.Seq2[A, B])
- func (m *Map[A, B]) Len() (length int)
- func (m *Map[A, B]) Put(a A, b B) (ok bool)
- type OwnerMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[A, B comparable] struct { // contains filtered or unexported fields }
Map is a simple BiMap. It can be inverted to get the other side.
type OwnerMap ¶
type OwnerMap[Owner comparable, Sub comparable] struct { // contains filtered or unexported fields }
OwnerMap is a map of one owner to many subordinates.
func (*OwnerMap[O, S]) Add ¶
Add adds the given sub to the owner. Fails if the sub is already owned.
Click to show internal directories.
Click to hide internal directories.