Struct P

Source
pub struct P { /* private fields */ }

Implementations§

Source§

impl P

Source

pub fn operator(&self) -> &String

Source

pub fn value(&self) -> &GValue

Source

pub fn eq<V>(value: V) -> P
where V: ToGValue,

Source

pub fn neq<V>(value: V) -> P
where V: ToGValue,

Source

pub fn gt<V>(value: V) -> P
where 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}
Source

pub fn gte<V>(value: V) -> P
where 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}
Source

pub fn lt<V>(value: V) -> P
where V: ToGValue,

Source

pub fn lte<V>(value: V) -> P
where V: ToGValue,

Source

pub fn within<V>(value: V) -> P
where 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§

Source§

impl Clone for P

Source§

fn clone(&self) -> P

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for P

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<P> for GValue

Source§

fn from(val: P) -> GValue

Converts to this type from the input type.
Source§

impl PartialEq for P

Source§

fn eq(&self, other: &P) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToGValue for P

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoPredicate for T
where T: ToGValue,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,