bag

package
v1.19.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bag

type Bag struct {
	// contains filtered or unexported fields
}

Bag is a collection of IDs with counts

func New

func New() *Bag

New creates a new bag

func (*Bag) Add

func (b *Bag) Add(id ids.ID)

Add adds an ID to the bag

func (*Bag) Count

func (b *Bag) Count(id ids.ID) int

Count returns the count for an ID

func (*Bag) Len

func (b *Bag) Len() int

Len returns the number of unique IDs

func (*Bag) List

func (b *Bag) List() []ids.ID

List returns all IDs in the bag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL