vector

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vector

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

func FromSlice

func FromSlice[T any](xs []T) *Vector[T]

func FromValues

func FromValues[T any](xs ...T) *Vector[T]

func Map

func Map[T any, R any](vec *Vector[T], f func(T) R) *Vector[R]

func MapFilter

func MapFilter[T any, R any](vec *Vector[T], f func(T) option.Option[R]) *Vector[R]

func WithCapacity

func WithCapacity[T any](cap int) *Vector[T]

func (*Vector[T]) Capacity

func (vec *Vector[T]) Capacity() int

func (*Vector[T]) Empty

func (vec *Vector[T]) Empty() bool

func (*Vector[T]) ForEach

func (vec *Vector[T]) ForEach(f func(T))

func (*Vector[T]) Push

func (vec *Vector[T]) Push(x T)

func (*Vector[T]) Reserve

func (vec *Vector[T]) Reserve(additional int)

func (*Vector[T]) ShrinkToFit

func (vec *Vector[T]) ShrinkToFit()

func (*Vector[T]) Size

func (vec *Vector[T]) Size() int

func (*Vector[T]) ToSlice

func (vec *Vector[T]) ToSlice() []T

func (*Vector[T]) TryPop

func (vec *Vector[T]) TryPop() option.Option[T]

Jump to

Keyboard shortcuts

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