1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use fmt;
/// The Apache TinkerPop `Column` token: which half of a map, or of a map entry, to read.
///
/// Used as `select(Column::Keys)` / `select(Column::Values)` (Gremlin: `select(keys)` /
/// `select(values)`). On a whole map (a `group()`/`group_count()` result, `project()`,
/// `element_map()`, ...) it yields one list of all keys/values; on a single entry produced by
/// `unfold()` of a map it yields that entry's key/value.
///
/// ```rust
/// use graphersal::prelude::*;
///
/// let graph = GraphSource::tinkerpop_modern();
/// let lock = graph.read();
/// let names = lock
/// .traversal()
/// .v(None::<()>)
/// .group_count()
/// .by("name")
/// .unfold()
/// .select(Column::Keys)
/// .to_list()
/// .unwrap();
/// assert_eq!(names.len(), 6);
/// ```
///
/// Closed set, so deliberately not `#[non_exhaustive]`: TinkerPop defines exactly these two columns.