Documentation
¶
Index ¶
- func Dispose(e *EditTree)
- type EditTree
- func (e *EditTree) Delete(key *ast.Term) (*EditTree, error)
- func (e *EditTree) DeleteAtPath(path ast.Ref) (*EditTree, error)
- func (e *EditTree) Exists(path ast.Ref) bool
- func (e *EditTree) Filter(paths []ast.Ref) *ast.Term
- func (e *EditTree) Insert(key, value *ast.Term) (*EditTree, error)
- func (e *EditTree) InsertAtPath(path ast.Ref, value *ast.Term) (*EditTree, error)
- func (e *EditTree) Reclaim() *EditTree
- func (e *EditTree) Render() *ast.Term
- func (e *EditTree) RenderAtPath(path ast.Ref) (*ast.Term, error)
- func (e *EditTree) String() string
- func (e *EditTree) Unfold(path ast.Ref) (*EditTree, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EditTree ¶
type EditTree struct {
// contains filtered or unexported fields
}
Deletions are encoded with a nil value pointer.
func EditTreeFromPool ¶ added in v1.14.0
Creates a new EditTree instance from the package-internal sync.Pool. Callers should call edittree.Dispose() to return the node when done.
func NewEditTree ¶
Creates a new EditTree node from term.
func (*EditTree) Delete ¶
Delete removes a child of e, or else creates a delete node for a term already present in e. It then returns the deleted child EditTree node.
func (*EditTree) DeleteAtPath ¶
DeleteAtPath traverses down the tree from e and uses the last path segment as the key to delete a node from the tree. Returns the deleted EditTree node.
func (*EditTree) Filter ¶
Filter pulls out only the values selected by paths. This is done recursively by plucking off one level from the paths each time we descend a level. Note: Values pulled from arrays will have the same approximate ordering in the final term.
func (*EditTree) InsertAtPath ¶
InsertAtPath traverses down the tree from e and uses the last path segment as the key to insert value into the tree. Returns the inserted EditTree node.
func (*EditTree) Reclaim ¶ added in v1.18.0
Reclaim is a recursive equivalent of Reset methods seen in other APIs.
func (*EditTree) Render ¶
Render generates the effective value for the term at e by recursively rendering the children of e, and then copying over any leftover keys from the original term stored at e.
func (*EditTree) RenderAtPath ¶
RenderAtPath traverses down the tree from e and renders the EditTree node at the end of path.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bitvector provides the implementation of a variable sized compact vector of bits which supports lookups, sets, appends, insertions, and deletions.
|
Package bitvector provides the implementation of a variable sized compact vector of bits which supports lookups, sets, appends, insertions, and deletions. |