Documentation
¶
Overview ¶
Package dict provides a data structure that wraps a map and allows repeatable traversals. The ordering is based on the order which the key / value pairs is set.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dict ¶
type Dict[K comparable, V any] struct { // contains filtered or unexported fields }
Dict wraps a map and allows for repeatable traversals, via the Keys method.
func (Dict[K, V]) Keys ¶
func (d Dict[K, V]) Keys() []K
Keys returns the keys of the Dict. The order of the slice is the order in which the values were set.
func (*Dict[K, V]) Set ¶
func (d *Dict[K, V]) Set(k K, v V)
Set creates a new entry in the Dict for the key k, and the value v. The ordering of the Dict is based on the order in which the key / value is Set. If the key / value pair already exists, it will be replaced and the original ordering is preserved.
Click to show internal directories.
Click to hide internal directories.