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

Function DescribeIterator

graph/iterator.go:141–159  ·  view source on GitHub ↗

DescribeIterator returns a description of the iterator tree.

(it Iterator)

Source from the content-addressed store, hash-verified

139
140// DescribeIterator returns a description of the iterator tree.
141func DescribeIterator(it Iterator) Description {
142 sz, exact := it.Size()
143 d := Description{
144 UID: uint64(reflect.ValueOf(it).Pointer()),
145 Name: it.String(),
146 Type: reflect.TypeOf(it).String(),
147 Size: sz, Exact: exact,
148 }
149 if tg, ok := it.(Tagger); ok {
150 d.Tags = tg.Tags()
151 }
152 if sub := it.SubIterators(); len(sub) != 0 {
153 d.Iterators = make([]Description, 0, len(sub))
154 for _, sit := range sub {
155 d.Iterators = append(d.Iterators, DescribeIterator(sit))
156 }
157 }
158 return d
159}
160
161type Description struct {
162 UID uint64 `json:",omitempty"`

Callers 1

startMethod · 0.85

Calls 5

SizeMethod · 0.65
ValueOfMethod · 0.65
StringMethod · 0.65
TagsMethod · 0.65
SubIteratorsMethod · 0.65

Tested by

no test coverage detected