pathlist

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Path

type Path[Elem any] struct {
	E Elem
	P *Path[Elem]
}

Path recursively represents a path.

The path represented by this Path is constructed by extending path P with element E.

For example, the path "0 -> 1 -> 2" is represented as

&Path[int]{
    E: 2,
    P: &Path[int]{
        E: 1,
        P: &Path[int]{
            E: 0,
            P: nil,
        }
    },
}

func (*Path[Elem]) ToList

func (p *Path[Elem]) ToList() []Elem

ToList describes the path represented by this Path as a list, whose items are the elements along the path, from the start to the end.

The client should guarantee that there is no change along the path during the call to this method.

Jump to

Keyboard shortcuts

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