ptr

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package ptr provides a generic interface for accessing an ordered collection of values sequentially, updating it and appending to it using a pointer (or cursor) type that keeps track of the current position. There are also implementations based on single scalar values, object attributes, or accessors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAcc

func NewAcc[V any](g func() V, s func(v V)) *acc[V]

func NewSlice

func NewSlice[V any]() *sptr[V]

Types

type Ptr

type Ptr[V any] interface {
	Append(V) Ptr[V]
	Insert(V, int) Ptr[V]
	Next() Ptr[V]
	Value() V
	Set(V) Ptr[V]
	Size() int
	Started() bool
	Seek(int) Ptr[V]
	Reset() Ptr[V]
	Clone() Ptr[V]
	New() Ptr[V]
	Copy() Ptr[V]
}

func Copy

func Copy[V any](p, np Ptr[V]) Ptr[V]

func New

func New[V any](p Ptr[V]) Ptr[V]

func NewScalar

func NewScalar[V any]() Ptr[V]

func NewVP

func NewVP[V any](vp *V) Ptr[V]

Jump to

Keyboard shortcuts

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