MCPcopy
hub / github.com/cayleygraph/cayley / IteratorBase

Interface IteratorBase

graph/iterator.go:56–93  ·  view source on GitHub ↗

IteratorBase is a set of common methods for Scanner and Index iterators.

Source from the content-addressed store, hash-verified

54
55// IteratorBase is a set of common methods for Scanner and Index iterators.
56type IteratorBase interface {
57 // String returns a short textual representation of an iterator.
58 String() string
59
60 // Fills a tag-to-result-value map.
61 TagResults(map[string]Ref)
62
63 // Returns the current result.
64 Result() Ref
65
66 // These methods are the heart and soul of the iterator, as they constitute
67 // the iteration interface.
68 //
69 // To get the full results of iteration, do the following:
70 //
71 // for graph.Next(it) {
72 // val := it.Result()
73 // ... do things with val.
74 // for it.NextPath() {
75 // ... find other paths to iterate
76 // }
77 // }
78 //
79 // All of them should set iterator.result to be the last returned value, to
80 // make results work.
81 //
82 // NextPath() advances iterators that may have more than one valid result,
83 // from the bottom up.
84 NextPath(ctx context.Context) bool
85
86 // Err returns any error that was encountered by the Iterator.
87 Err() error
88
89 // TODO: make a requirement that Err should return ErrClosed after Close is called
90
91 // Close the iterator and do internal cleanup.
92 Close() error
93}
94
95type Iterator interface {
96 IteratorBase

Callers 34

DescribeIteratorFunction · 0.65
DumpStatsFunction · 0.65
NextMethod · 0.65
TestSexpFunction · 0.65
ResultMethod · 0.65
iterateObjectFunction · 0.65
loadIteratorToDepthMethod · 0.65
TagResultsMethod · 0.65
TagEachMethod · 0.65
testOptimizeFunction · 0.65
ReadQuadMethod · 0.65
ResultMethod · 0.65

Implementers 15

legacyItergraph/shape.go
allIteratorNextgraph/kv/all_iterator.go
allIteratorContainsgraph/kv/all_iterator.go
quadIteratorNextgraph/kv/quad_iterator.go
quadIteratorContainsgraph/kv/quad_iterator.go
iteratorNextgraph/nosql/iterator.go
iteratorContainsgraph/nosql/iterator.go
allIteratorNextgraph/memstore/all_iterator.go
allIteratorContainsgraph/memstore/all_iterator.go
iteratorNextgraph/memstore/iterator.go
iteratorContainsgraph/memstore/iterator.go
uniqueNextgraph/iterator/unique.go

Calls

no outgoing calls

Tested by

no test coverage detected