pub struct TraversalBuilder { /* private fields */ }
Implementations§
Source§impl TraversalBuilder
impl TraversalBuilder
pub fn new(bytecode: Bytecode) -> Self
pub fn bytecode(&self) -> &Bytecode
pub fn v<T>(self, ids: T) -> TraversalBuilder
pub fn e<T>(self, ids: T) -> TraversalBuilder
pub fn has_label<L>(self, labels: L) -> Self
pub fn add_v<A>(self, label: A) -> Self
pub fn property<K, A>(self, key: K, value: A) -> Self
pub fn property_many<A>(self, values: Vec<(String, A)>) -> Self
pub fn property_with_cardinality<A>( self, cardinality: Cardinality, key: &str, value: A, ) -> Self
pub fn has<A>(self, step: A) -> Self
pub fn side_effect<A>(self, step: A) -> Selfwhere
A: IntoSideEffectStep,
pub fn with_side_effect<A>(self, step: (&'static str, A)) -> Self
pub fn has_many<A>(self, steps: Vec<A>) -> Self
pub fn has_not<A>(self, key: A) -> Self
pub fn as_<A>(self, alias: A) -> Self
pub fn add_e<A>(self, label: A) -> Self
pub fn out<A>(self, labels: A) -> Self
pub fn out_e<A>(self, labels: A) -> Self
pub fn out_v(self) -> Self
pub fn in_<A>(self, labels: A) -> Self
pub fn in_e<A>(self, labels: A) -> Self
pub fn in_v(self) -> Self
pub fn both<A>(self, labels: A) -> Self
pub fn both_e<A>(self, labels: A) -> Self
pub fn other(self) -> Self
pub fn other_v(self) -> Self
pub fn label(self) -> Self
pub fn from<A>(self, step: A) -> Self
pub fn to<A>(self, step: A) -> Self
pub fn properties<L>(self, labels: L) -> Self
pub fn property_map<L>(self, labels: L) -> Self
pub fn values<L>(self, labels: L) -> Self
pub fn value_map<L>(self, labels: L) -> Self
pub fn element_map<L>(self, labels: L) -> Self
Sourcepub fn count(self) -> Self
pub fn count(self) -> Self
Examples found in repository?
examples/traversal_complex.rs (line 51)
7fn main() -> Result<(), Box<dyn std::error::Error>> {
8 let client = GremlinClient::connect("localhost")?;
9
10 let g = traversal().with_remote(client);
11
12 create_graph(&g)?;
13
14 let result = g
15 .v(())
16 .has_label("complex_vertex")
17 .has(("name", "test1"))
18 .out("complex_label")
19 .out("complex_label")
20 .value_map(())
21 .next()?
22 .expect("no vertices found");
23
24 println!(
25 "Found vertex with name {:?}",
26 result["name"].get::<List>().unwrap()[0]
27 );
28
29 let results = g
30 .v(())
31 .has_label("complex_vertex")
32 .has(("number", P::gt(3)))
33 .to_list()?;
34
35 println!(
36 "Found {} vertices with number greater than 3",
37 results.len()
38 );
39
40 let results = g
41 .v(())
42 .has_label("complex_vertex")
43 .has(("number", P::within((3, 6))))
44 .to_list()?;
45
46 println!("Found {} vertices with number 3 or 6", results.len());
47
48 let results = g
49 .v(())
50 .has_label("complex_vertex")
51 .where_(__.out("complex_label").count().is(P::gte(1)))
52 .to_list()?;
53
54 println!(
55 "Found {} vertices with 1 or more connected edges with label complex_label",
56 results.len()
57 );
58
59 Ok(())
60}
pub fn group_count(self, key: Option<String>) -> Self
pub fn group(self, key: Option<String>) -> Self
pub fn by<A>(self, step: A) -> Self
pub fn select<A>(self, step: A) -> Selfwhere
A: Into<SelectStep>,
pub fn fold(self) -> Self
pub fn unfold(self) -> Self
pub fn path(self) -> Self
pub fn limit<A>(self, limit: A) -> Self
pub fn dedup<A>(self, limit: A) -> Self
pub fn sum<A>(self, scope: A) -> Self
pub fn max<A>(self, scope: A) -> Self
pub fn mean<A>(self, scope: A) -> Self
pub fn min<A>(self, scope: A) -> Self
Sourcepub fn is<A>(self, val: A) -> Selfwhere
A: IntoPredicate,
pub fn is<A>(self, val: A) -> Selfwhere
A: IntoPredicate,
Examples found in repository?
examples/traversal_complex.rs (line 51)
7fn main() -> Result<(), Box<dyn std::error::Error>> {
8 let client = GremlinClient::connect("localhost")?;
9
10 let g = traversal().with_remote(client);
11
12 create_graph(&g)?;
13
14 let result = g
15 .v(())
16 .has_label("complex_vertex")
17 .has(("name", "test1"))
18 .out("complex_label")
19 .out("complex_label")
20 .value_map(())
21 .next()?
22 .expect("no vertices found");
23
24 println!(
25 "Found vertex with name {:?}",
26 result["name"].get::<List>().unwrap()[0]
27 );
28
29 let results = g
30 .v(())
31 .has_label("complex_vertex")
32 .has(("number", P::gt(3)))
33 .to_list()?;
34
35 println!(
36 "Found {} vertices with number greater than 3",
37 results.len()
38 );
39
40 let results = g
41 .v(())
42 .has_label("complex_vertex")
43 .has(("number", P::within((3, 6))))
44 .to_list()?;
45
46 println!("Found {} vertices with number 3 or 6", results.len());
47
48 let results = g
49 .v(())
50 .has_label("complex_vertex")
51 .where_(__.out("complex_label").count().is(P::gte(1)))
52 .to_list()?;
53
54 println!(
55 "Found {} vertices with 1 or more connected edges with label complex_label",
56 results.len()
57 );
58
59 Ok(())
60}
pub fn where_<A>(self, step: A) -> Self
pub fn not<A>(self, step: A) -> Self
pub fn order<A>(self, scope: A) -> Self
pub fn match_<A>(self, step: A) -> Self
pub fn drop(self) -> Self
pub fn or<A>(self, step: A) -> Self
pub fn project<A>(self, step: A) -> Selfwhere
A: Into<SelectStep>,
pub fn map<A>(self, step: A) -> Self
pub fn repeat<A>(self, step: A) -> Selfwhere
A: Into<RepeatStep>,
pub fn until<A>(self, step: A) -> Self
pub fn simple_path(self) -> Self
pub fn sample(self, step: i32) -> Self
pub fn loops<A>(self, step: A) -> Self
pub fn local<A>(self, step: A) -> Self
pub fn aggregate<A>(self, alias: A) -> Self
pub fn value(self) -> Self
pub fn choose<A>(self, step: A) -> Selfwhere
A: IntoChooseStep,
pub fn coalesce<A>(self, coalesce: A) -> Selfwhere
A: Into<CoalesceStep>,
pub fn identity(self) -> Self
pub fn range(self, step: i64, step2: i64) -> Self
pub fn cap(self, step: &'static str) -> Self
pub fn barrier(self) -> Self
pub fn optional(self, step: TraversalBuilder) -> Self
pub fn constant<A>(self, value: A) -> Self
pub fn emit(self) -> Self
pub fn id(self) -> Self
Trait Implementations§
Source§impl Clone for TraversalBuilder
impl Clone for TraversalBuilder
Source§fn clone(&self) -> TraversalBuilder
fn clone(&self) -> TraversalBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for TraversalBuilder
impl Default for TraversalBuilder
Source§impl From<TraversalBuilder> for ByStep
impl From<TraversalBuilder> for ByStep
Source§fn from(param: TraversalBuilder) -> Self
fn from(param: TraversalBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for CoalesceStep
impl From<TraversalBuilder> for CoalesceStep
Source§fn from(param: TraversalBuilder) -> Self
fn from(param: TraversalBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for FromStep
impl From<TraversalBuilder> for FromStep
Source§fn from(param: TraversalBuilder) -> Self
fn from(param: TraversalBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for LocalStep
impl From<TraversalBuilder> for LocalStep
Source§fn from(param: TraversalBuilder) -> LocalStep
fn from(param: TraversalBuilder) -> LocalStep
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for MatchStep
impl From<TraversalBuilder> for MatchStep
Source§fn from(param: TraversalBuilder) -> MatchStep
fn from(param: TraversalBuilder) -> MatchStep
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for NotStep
impl From<TraversalBuilder> for NotStep
Source§fn from(param: TraversalBuilder) -> Self
fn from(param: TraversalBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for OrStep
impl From<TraversalBuilder> for OrStep
Source§fn from(param: TraversalBuilder) -> Self
fn from(param: TraversalBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for RepeatStep
impl From<TraversalBuilder> for RepeatStep
Source§fn from(param: TraversalBuilder) -> RepeatStep
fn from(param: TraversalBuilder) -> RepeatStep
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for SelectStep
impl From<TraversalBuilder> for SelectStep
Source§fn from(param: TraversalBuilder) -> SelectStep
fn from(param: TraversalBuilder) -> SelectStep
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for ToStep
impl From<TraversalBuilder> for ToStep
Source§fn from(param: TraversalBuilder) -> Self
fn from(param: TraversalBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for UntilStep
impl From<TraversalBuilder> for UntilStep
Source§fn from(param: TraversalBuilder) -> Self
fn from(param: TraversalBuilder) -> Self
Converts to this type from the input type.
Source§impl From<TraversalBuilder> for WhereStep
impl From<TraversalBuilder> for WhereStep
Source§fn from(param: TraversalBuilder) -> WhereStep
fn from(param: TraversalBuilder) -> WhereStep
Converts to this type from the input type.
Source§impl IntoChooseStep for TraversalBuilder
impl IntoChooseStep for TraversalBuilder
Auto Trait Implementations§
impl Freeze for TraversalBuilder
impl RefUnwindSafe for TraversalBuilder
impl Send for TraversalBuilder
impl Sync for TraversalBuilder
impl Unpin for TraversalBuilder
impl UnwindSafe for TraversalBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more