array

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT, Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultElementsPerBucket = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type Stable

type Stable[T any] struct {
	// contains filtered or unexported fields
}

Stable is a resizable array whose values will never move in memory. This means it is safe to take a pointer to a value within the array while continuing to append to it.

func (*Stable[T]) Append

func (s *Stable[T]) Append(value T) *T

func (*Stable[T]) AppendMany

func (s *Stable[T]) AppendMany(values ...T) (first *T)

func (*Stable[T]) Cap

func (s *Stable[T]) Cap() int

func (*Stable[T]) Get

func (s *Stable[T]) Get(index int) *T

func (*Stable[T]) Init

func (s *Stable[T]) Init()

func (*Stable[T]) InitWithCapacity added in v1.0.1

func (s *Stable[T]) InitWithCapacity(elementsPerBucket int)

func (*Stable[T]) Len

func (s *Stable[T]) Len() int

func (*Stable[T]) Pointers

func (s *Stable[T]) Pointers() iter.Seq2[int, *T]

func (*Stable[T]) Values

func (s *Stable[T]) Values() iter.Seq2[int, T]

Jump to

Keyboard shortcuts

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