pub struct P { /* private fields */ }
Implementations§
Source§impl P
impl P
pub fn operator(&self) -> &String
pub fn value(&self) -> &GValue
pub fn eq<V>(value: V) -> Pwhere
V: ToGValue,
pub fn neq<V>(value: V) -> Pwhere
V: ToGValue,
Sourcepub fn gt<V>(value: V) -> Pwhere
V: ToGValue,
pub fn gt<V>(value: V) -> Pwhere
V: ToGValue,
Examples found in repository?
examples/traversal_complex.rs (line 32)
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}
Sourcepub fn gte<V>(value: V) -> Pwhere
V: ToGValue,
pub fn gte<V>(value: V) -> Pwhere
V: ToGValue,
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 lt<V>(value: V) -> Pwhere
V: ToGValue,
pub fn lte<V>(value: V) -> Pwhere
V: ToGValue,
Sourcepub fn within<V>(value: V) -> Pwhere
V: IntoRange,
pub fn within<V>(value: V) -> Pwhere
V: IntoRange,
Examples found in repository?
examples/traversal_complex.rs (line 43)
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}
Trait Implementations§
impl StructuralPartialEq for P
Auto Trait Implementations§
impl Freeze for P
impl RefUnwindSafe for P
impl Send for P
impl Sync for P
impl Unpin for P
impl UnwindSafe for P
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