clist

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CList

type CList struct {
	// contains filtered or unexported fields
}

CList a concurrent safe list

func New

func New() *CList

New create an instance of CList

func (*CList) Front

func (cl *CList) Front() *list.Element

Front returns the first element of list l or nil if the list is empty.

func (*CList) Len

func (cl *CList) Len() int

Len returns the number of elements of list l. The complexity is O(1).

func (*CList) PushBack

func (cl *CList) PushBack(v any) *list.Element

PushBack inserts a new element e with value v at the back of list l and returns e.

func (*CList) Remove

func (cl *CList) Remove(e *list.Element) any

Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.

Jump to

Keyboard shortcuts

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