gremlin_client/process/traversal/step/
by.rs1use crate::process::traversal::{Order, TraversalBuilder};
2use crate::structure::{GValue, T};
3
4pub struct ByStep {
5 params: Vec<GValue>,
6}
7
8impl ByStep {
9 fn new(params: Vec<GValue>) -> Self {
10 ByStep { params }
11 }
12}
13
14impl From<ByStep> for Vec<GValue> {
15 fn from(step: ByStep) -> Self {
16 step.params
17 }
18}
19
20impl From<()> for ByStep {
21 fn from(_: ()) -> Self {
22 ByStep::new(vec![])
23 }
24}
25
26impl From<&str> for ByStep {
27 fn from(param: &str) -> Self {
28 ByStep::new(vec![String::from(param).into()])
29 }
30}
31
32impl From<Order> for ByStep {
33 fn from(param: Order) -> Self {
34 ByStep::new(vec![param.into()])
35 }
36}
37
38impl From<T> for ByStep {
39 fn from(param: T) -> Self {
40 ByStep::new(vec![param.into()])
41 }
42}
43
44impl From<(&str, Order)> for ByStep {
45 fn from(param: (&str, Order)) -> Self {
46 ByStep::new(vec![param.0.into(), param.1.into()])
47 }
48}
49
50impl From<(String, Order)> for ByStep {
51 fn from(param: (String, Order)) -> Self {
52 ByStep::new(vec![param.0.into(), param.1.into()])
53 }
54}
55
56impl From<(TraversalBuilder, Order)> for ByStep {
57 fn from(param: (TraversalBuilder, Order)) -> Self {
58 ByStep::new(vec![param.0.bytecode.into(), param.1.into()])
59 }
60}
61
62impl From<TraversalBuilder> for ByStep {
63 fn from(param: TraversalBuilder) -> Self {
64 ByStep::new(vec![param.bytecode.into()])
65 }
66}