MutableHierarchicalCollection
public protocol MutableHierarchicalCollection : HierarchicalCollection
MutableHierarchicalCollection extends HierarchicalCollections to allow mutation of contents.
While many algorithms simply query the data structure in order to do their work, some algorithms modify the data structure. This protocol abstracts over a set of common mutation operations of hierarchical data structures.
-
Swaps the contents of
lhsandrhs.Declaration
Swift
mutating func swapAt(_ lhs: Self.Cursor, _ rhs: Self.Cursor) -
Applies
fnto each element in the hierarchical collection.Declaration
Swift
mutating func forEachMut(_ fn: (inout Element) throws -> Void) rethrows
View on GitHub
MutableHierarchicalCollection Protocol Reference