slices

package
v0.30.38 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Item added in v0.30.25

func Item[T comparable](t T) func(T) bool

Item create a function that check equality to a supplied literal. It requires comparable items.

Types

type Safe added in v0.30.25

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

Safe is a slice wrapper to provide some concurrent operations. It is optimized for reads using the copy-on-write idiom.

func NewSafe added in v0.30.25

func NewSafe[T any](initial ...T) *Safe[T]

NewSafe create a Safe slice with initial items.

func (*Safe[T]) Append added in v0.30.25

func (s *Safe[T]) Append(items ...T) *Safe[T]

func (*Safe[T]) Delete added in v0.30.25

func (s *Safe[T]) Delete(eq func(T) (bool, bool)) *Safe[T]

func (*Safe[T]) Index added in v0.30.25

func (s *Safe[T]) Index(eq func(T) bool) int

func (*Safe[T]) Insert added in v0.30.25

func (s *Safe[T]) Insert(index int, items ...T) *Safe[T]

func (*Safe[T]) Items added in v0.30.25

func (s *Safe[T]) Items() []T

func (*Safe[T]) Reset added in v0.30.25

func (s *Safe[T]) Reset(items ...T) *Safe[T]

Jump to

Keyboard shortcuts

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