Struct TraversalBuilder

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

Implementations§

Source§

impl TraversalBuilder

Source

pub fn new(bytecode: Bytecode) -> Self

Source

pub fn bytecode(&self) -> &Bytecode

Source

pub fn v<T>(self, ids: T) -> TraversalBuilder
where T: Into<GIDs>,

Source

pub fn e<T>(self, ids: T) -> TraversalBuilder
where T: Into<GIDs>,

Source

pub fn has_label<L>(self, labels: L) -> Self
where L: Into<Labels>,

Source

pub fn add_v<A>(self, label: A) -> Self
where A: Into<Labels>,

Source

pub fn property<K, A>(self, key: K, value: A) -> Self
where K: Into<GValue>, A: Into<GValue>,

Source

pub fn property_many<A>(self, values: Vec<(String, A)>) -> Self
where A: Into<GValue>,

Source

pub fn property_with_cardinality<A>( self, cardinality: Cardinality, key: &str, value: A, ) -> Self
where A: Into<GValue>,

Source

pub fn has<A>(self, step: A) -> Self
where A: Into<HasStep>,

Source

pub fn side_effect<A>(self, step: A) -> Self

Source

pub fn with_side_effect<A>(self, step: (&'static str, A)) -> Self
where A: Into<GValue> + FromGValue,

Source

pub fn has_many<A>(self, steps: Vec<A>) -> Self
where A: Into<HasStep>,

Source

pub fn has_not<A>(self, key: A) -> Self
where A: Into<String>,

Source

pub fn as_<A>(self, alias: A) -> Self
where A: Into<String>,

Source

pub fn add_e<A>(self, label: A) -> Self
where A: Into<Labels>,

Source

pub fn out<A>(self, labels: A) -> Self
where A: Into<Labels>,

Source

pub fn out_e<A>(self, labels: A) -> Self
where A: Into<Labels>,

Source

pub fn out_v(self) -> Self

Source

pub fn in_<A>(self, labels: A) -> Self
where A: Into<Labels>,

Source

pub fn in_e<A>(self, labels: A) -> Self
where A: Into<Labels>,

Source

pub fn in_v(self) -> Self

Source

pub fn both<A>(self, labels: A) -> Self
where A: Into<Labels>,

Source

pub fn both_e<A>(self, labels: A) -> Self
where A: Into<Labels>,

Source

pub fn other(self) -> Self

Source

pub fn other_v(self) -> Self

Source

pub fn label(self) -> Self

Source

pub fn from<A>(self, step: A) -> Self
where A: Into<FromStep>,

Source

pub fn to<A>(self, step: A) -> Self
where A: Into<ToStep>,

Source

pub fn properties<L>(self, labels: L) -> Self
where L: Into<Labels>,

Source

pub fn property_map<L>(self, labels: L) -> Self
where L: Into<Labels>,

Source

pub fn values<L>(self, labels: L) -> Self
where L: Into<Labels>,

Source

pub fn value_map<L>(self, labels: L) -> Self
where L: Into<Labels>,

Source

pub fn element_map<L>(self, labels: L) -> Self
where L: Into<Labels>,

Source

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}
Source

pub fn group_count(self, key: Option<String>) -> Self

Source

pub fn group(self, key: Option<String>) -> Self

Source

pub fn by<A>(self, step: A) -> Self
where A: Into<ByStep>,

Source

pub fn select<A>(self, step: A) -> Self
where A: Into<SelectStep>,

Source

pub fn fold(self) -> Self

Source

pub fn unfold(self) -> Self

Source

pub fn path(self) -> Self

Source

pub fn limit<A>(self, limit: A) -> Self
where A: Into<LimitStep>,

Source

pub fn dedup<A>(self, limit: A) -> Self
where A: Into<DedupStep>,

Source

pub fn sum<A>(self, scope: A) -> Self
where A: Into<Scope>,

Source

pub fn max<A>(self, scope: A) -> Self
where A: Into<Scope>,

Source

pub fn mean<A>(self, scope: A) -> Self
where A: Into<Scope>,

Source

pub fn min<A>(self, scope: A) -> Self
where A: Into<Scope>,

Source

pub fn is<A>(self, val: A) -> Self
where 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}
Source

pub fn where_<A>(self, step: A) -> Self
where A: Into<WhereStep>,

Source

pub fn not<A>(self, step: A) -> Self
where A: Into<NotStep>,

Source

pub fn order<A>(self, scope: A) -> Self
where A: Into<Scope>,

Source

pub fn match_<A>(self, step: A) -> Self
where A: Into<MatchStep>,

Source

pub fn drop(self) -> Self

Source

pub fn or<A>(self, step: A) -> Self
where A: Into<OrStep>,

Source

pub fn project<A>(self, step: A) -> Self
where A: Into<SelectStep>,

Source

pub fn map<A>(self, step: A) -> Self
where A: Into<ByStep>,

Source

pub fn repeat<A>(self, step: A) -> Self
where A: Into<RepeatStep>,

Source

pub fn until<A>(self, step: A) -> Self
where A: Into<UntilStep>,

Source

pub fn simple_path(self) -> Self

Source

pub fn sample(self, step: i32) -> Self

Source

pub fn loops<A>(self, step: A) -> Self
where A: Into<LoopsStep>,

Source

pub fn local<A>(self, step: A) -> Self
where A: Into<LocalStep>,

Source

pub fn aggregate<A>(self, alias: A) -> Self
where A: Into<String>,

Source

pub fn value(self) -> Self

Source

pub fn choose<A>(self, step: A) -> Self
where A: IntoChooseStep,

Source

pub fn coalesce<A>(self, coalesce: A) -> Self
where A: Into<CoalesceStep>,

Source

pub fn identity(self) -> Self

Source

pub fn range(self, step: i64, step2: i64) -> Self

Source

pub fn cap(self, step: &'static str) -> Self

Source

pub fn barrier(self) -> Self

Source

pub fn optional(self, step: TraversalBuilder) -> Self

Source

pub fn constant<A>(self, value: A) -> Self
where A: Into<GValue>,

Source

pub fn emit(self) -> Self

Source

pub fn id(self) -> Self

Trait Implementations§

Source§

impl Clone for TraversalBuilder

Source§

fn clone(&self) -> TraversalBuilder

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 Default for TraversalBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<TraversalBuilder> for ByStep

Source§

fn from(param: TraversalBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for CoalesceStep

Source§

fn from(param: TraversalBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for FromStep

Source§

fn from(param: TraversalBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for LocalStep

Source§

fn from(param: TraversalBuilder) -> LocalStep

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for MatchStep

Source§

fn from(param: TraversalBuilder) -> MatchStep

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for NotStep

Source§

fn from(param: TraversalBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for OrStep

Source§

fn from(param: TraversalBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for RepeatStep

Source§

fn from(param: TraversalBuilder) -> RepeatStep

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for SelectStep

Source§

fn from(param: TraversalBuilder) -> SelectStep

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for ToStep

Source§

fn from(param: TraversalBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for UntilStep

Source§

fn from(param: TraversalBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<TraversalBuilder> for WhereStep

Source§

fn from(param: TraversalBuilder) -> WhereStep

Converts to this type from the input type.
Source§

impl IntoChooseStep for TraversalBuilder

Source§

impl IntoSideEffectStep for TraversalBuilder

Auto Trait Implementations§

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> 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,