Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityMap ¶ added in v0.1.1
type PriorityMap[K comparable, V any, P Priority] struct { // contains filtered or unexported fields }
PriorityMap provides a map with a built-in priority queue for trimming.
func NewPriorityMap ¶ added in v0.1.1
func NewPriorityMap[K comparable, V any, P Priority]() PriorityMap[K, V, P]
NewPriorityMap creates a new empty priority queue.
func (*PriorityMap[K, V, P]) Delete ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Delete(key K)
Delete an element from the map.
func (*PriorityMap[K, V, P]) Get ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Get(key K) (V, bool)
Get an element in the map by its key.
func (*PriorityMap[K, V, P]) Len ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Len() int
Len returns the number of elements in the queue.
func (*PriorityMap[K, V, P]) Next ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Next() (K, V, bool)
Next returns the next value in the map with the lowest priority.
func (*PriorityMap[K, V, P]) Set ¶ added in v0.1.1
func (p *PriorityMap[K, V, P]) Set(key K, val V, pri P)
Set an element in the map to the given value and priority.
Click to show internal directories.
Click to hide internal directories.