github.com/sagernet/sing@v0.4.0-beta.19.0.20240518125136-f67a0988a636/common/x/collections/map.go (about) 1 package collections 2 3 type Map[K comparable, V any] interface { 4 Size() int 5 IsEmpty() bool 6 ContainsKey(key K) bool 7 Get(key K) (V, bool) 8 Put(key K, value V) V 9 Remove(key K) bool 10 PutAll(other Map[K, V]) 11 Clear() 12 Keys() []K 13 Values() []V 14 Entries() []MapEntry[K, V] 15 } 16 17 type MapEntry[K comparable, V any] struct { 18 Key K 19 Value V 20 }