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