gremlin_client/process/traversal/step/
from.rs

1use crate::process::traversal::TraversalBuilder;
2use crate::structure::{GValue, Vertex};
3
4pub struct FromStep {
5    params: Vec<GValue>,
6}
7
8impl FromStep {
9    fn new(params: Vec<GValue>) -> Self {
10        FromStep { params }
11    }
12}
13
14impl From<FromStep> for Vec<GValue> {
15    fn from(step: FromStep) -> Self {
16        step.params
17    }
18}
19
20impl From<&str> for FromStep {
21    fn from(param: &str) -> Self {
22        FromStep::new(vec![param.into()])
23    }
24}
25
26impl From<&Vertex> for FromStep {
27    fn from(param: &Vertex) -> Self {
28        FromStep::new(vec![param.into()])
29    }
30}
31
32impl From<TraversalBuilder> for FromStep {
33    fn from(param: TraversalBuilder) -> Self {
34        FromStep::new(vec![param.bytecode.into()])
35    }
36}