stack

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: GPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorEmptyStack = errors.New("empty Stack")

Functions

This section is empty.

Types

type AsyncStack

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

func NewAsyncStack

func NewAsyncStack[T any]() *AsyncStack[T]

func (*AsyncStack[T]) Empty

func (st *AsyncStack[T]) Empty() bool

func (*AsyncStack[T]) Pop

func (st *AsyncStack[T]) Pop() (T, error)

func (*AsyncStack[T]) Push

func (st *AsyncStack[T]) Push(value T)

func (*AsyncStack[T]) Top

func (st *AsyncStack[T]) Top() (T, error)

type Stack

type Stack[T any] []T

func NewStack

func NewStack[T any]() Stack[T]

func (*Stack[T]) Empty

func (st *Stack[T]) Empty() bool

func (*Stack[T]) Pop

func (st *Stack[T]) Pop() (T, error)

func (*Stack[T]) Push

func (st *Stack[T]) Push(value T)

func (*Stack[T]) Top

func (st *Stack[T]) Top() (T, error)

Jump to

Keyboard shortcuts

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