Source File
snapshot.go
Belonging Package
github.com/pancsta/d2/d2layouts/d2talalayout/internal/routing
package routingimport ()type pointerSnapshot[ any] struct {pointer *value}func snapshotPointer[ any]( *) pointerSnapshot[] {if == nil {return pointerSnapshot[]{}}return pointerSnapshot[]{pointer: , value: *}}func ( pointerSnapshot[]) () * {if .pointer == nil {return nil}*.pointer = .valuereturn .pointer}type exactSliceSnapshot[ ~[], any] struct {originalbacking []}func ( exactSliceSnapshot[, ]) () {if .original == nil {return nil}copy(.original[:cap(.original)], .backing)return .original}type edgeSnapshot struct {value layoutgraph.Edged2ID pointerSnapshot[string]points exactSliceSnapshot[[]*geo.Point, *geo.Point]pointValues []pointerSnapshot[geo.Point]label pointerSnapshot[layoutgraph.Label]sourceArrowheadLabel pointerSnapshot[layoutgraph.Label]targetArrowheadLabel pointerSnapshot[layoutgraph.Label]fromTableColumnIndex pointerSnapshot[int]toTableColumnIndex pointerSnapshot[int]}func ( edgeSnapshot) ( *layoutgraph.Edge) {.d2ID.restore().label.restore().sourceArrowheadLabel.restore().targetArrowheadLabel.restore().fromTableColumnIndex.restore().toTableColumnIndex.restore()for , := range .pointValues {.restore()}:= .points.restore()* = .value.D2ID = .d2ID.pointer.Points =.Label = .label.pointer.SourceArrowheadLabel = .sourceArrowheadLabel.pointer.TargetArrowheadLabel = .targetArrowheadLabel.pointer.FromTableColumnIndex = .fromTableColumnIndex.pointer.ToTableColumnIndex = .toTableColumnIndex.pointer}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |