Documentation ¶
Index ¶
- type Pair
- type PairSlice
- func (ps *PairSlice[K, V]) Append(first K, second V)
- func (ps *PairSlice[K, V]) First() (K, V, bool)
- func (ps *PairSlice[K, V]) Get(index int) (K, V, bool)
- func (ps *PairSlice[K, V]) Last() (K, V, bool)
- func (ps *PairSlice[K, V]) Len() int
- func (ps *PairSlice[K, V]) RemoveFirst()
- func (ps *PairSlice[K, V]) RemoveLast()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pair ¶
type Pair[K comparable, V any] struct { First K Second V }
Pair represents a key-value pair.
type PairSlice ¶
type PairSlice[K comparable, V any] struct { // contains filtered or unexported fields }
PairSlice represents a slice of key-value pairs.
func New ¶
func New[K comparable, V any](capacity int) *PairSlice[K, V]
New creates a new instance of PairSlice with a specified capacity.
func (*PairSlice[K, V]) Append ¶
func (ps *PairSlice[K, V]) Append(first K, second V)
Append adds the first and second to the end of the slice.
func (*PairSlice[K, V]) First ¶
First returns the first properties in the PairSlice. If the PairSlice is empty, it returns false.
func (*PairSlice[K, V]) Get ¶
Get returns the properties at the specified index. If the index is out of bounds, it returns false.
func (*PairSlice[K, V]) Last ¶
Last returns the last properties in the PairSlice. If the PairSlice is empty, it returns false.
func (*PairSlice[K, V]) RemoveFirst ¶
func (ps *PairSlice[K, V]) RemoveFirst()
RemoveFirst removes the first element from PairSlice.
func (*PairSlice[K, V]) RemoveLast ¶
func (ps *PairSlice[K, V]) RemoveLast()
RemoveLast removes the last element from PairSlice.
Click to show internal directories.
Click to hide internal directories.