Much of the API of ContiguousSegmentCollection is also needed on ContiguousSegmentCollection.Fragment.
Add a ContiguousSegmentCollectionProtocol which unifies the shared bits.
For example:
protocol ContiguousSegmentCollectionProtocol {
func segment(containing target: Metric) -> Segment?
...
}
Much of the API of
ContiguousSegmentCollectionis also needed onContiguousSegmentCollection.Fragment.Add a
ContiguousSegmentCollectionProtocolwhich unifies the shared bits.For example: