Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

struct libtmux-go latest

SparseArray

SparseArray stores values at sorted, nonnegative indices. Its zero value is an empty array. Constructors and functional updates own their entry slices; copies of reference-bearing T values remain shallow.

Source and package
Qualified name
tmux.SparseArray
Package
tmux
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/sparse_array.go
struct tmux.SparseArray
Type parameters

Members8#

  • All method All returns an iterator over indices and values in ascending index order.
  • Append method Append returns a copy with value stored after the highest present index. It leaves the receiver unchanged and returns an error matching ErrInvalidSparseIndex when that index overflows.
  • Entries method Entries returns a fresh shallow copy in ascending index order.
  • Get method Get returns the value at index and reports whether it is present. A missing index, including a sparse hole, returns the zero value and false.
  • Indices method Indices returns a fresh slice of present indices in ascending order.
  • Len method Len returns the number of present entries, not the highest index.
  • Values method Values returns a fresh shallow slice in ascending index order.
  • With method With returns a copy with value inserted or replaced at index. It leaves the receiver unchanged and returns an error matching ErrInvalidSparseIndex for a negative index.
Esc

Type to search.

Reference previewOpen reference