Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stringify ¶ added in v0.2.4
func Stringify[T comparable](node Node[T], options StringifyOptions) string
Stringify converts node to string
Types ¶
type Node ¶ added in v0.2.3
type Node[T comparable] interface { ToString() string // ToString returns node self information Parent() T // Parent returns parent node or nil NumChild() int // NumChild returns number of child GetChildByIndex(i int) T // GetChildByIndex gets child by index }
Node represents a generic printable node
type Pair ¶ added in v0.1.0
type Pair[T1, T2 any] struct { First T1 Second T2 }
Pair contains two values like c++ std::pair
type StringifyOptions ¶ added in v0.2.4
type StringifyOptions struct {
Prefix string
IconParent string // default "│ "
IconSpace string // default " "
IconBranch string // default "├──"
IconLastBranch string // default "└──"
}
StringifyOptions represents a options for stringify Node
func (*StringifyOptions) Fix ¶ added in v0.2.4
func (options *StringifyOptions) Fix()
Click to show internal directories.
Click to hide internal directories.