swap

package
v0.0.0-...-052ef2a Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slice

type Slice[T comparable] struct {
	// contains filtered or unexported fields
}

func New

func New[T comparable](getter func(T) int, setter func(T, int)) *Slice[T]

func (*Slice[T]) Add

func (s *Slice[T]) Add(value T)

func (*Slice[T]) Get

func (s *Slice[T]) Get(index int) (value T, ok bool)

func (*Slice[T]) Iterate

func (s *Slice[T]) Iterate(fn func(T) bool)

func (*Slice[T]) Len

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

func (*Slice[T]) Remove

func (s *Slice[T]) Remove(value T) bool

type SyncSlice

type SyncSlice[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSync

func NewSync[T comparable](getter func(T) int, setter func(T, int)) *SyncSlice[T]

func (*SyncSlice[T]) Add

func (s *SyncSlice[T]) Add(value T)

func (*SyncSlice[T]) CopyTo

func (s *SyncSlice[T]) CopyTo(to []T) []T

func (*SyncSlice[T]) Get

func (s *SyncSlice[T]) Get(index int) (value T, ok bool)

func (*SyncSlice[T]) Iterate

func (s *SyncSlice[T]) Iterate(fn func(T) bool)

func (*SyncSlice[T]) Len

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

func (*SyncSlice[T]) Remove

func (s *SyncSlice[T]) Remove(value T) bool

func (*SyncSlice[T]) Unsafe

func (s *SyncSlice[T]) Unsafe() []T

Jump to

Keyboard shortcuts

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