la_rete/json/js_path.rs
1#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2pub struct JsPath {
3 pub(super) path: Vec<String>,
4}
5
6impl JsPath {
7 pub fn from_path<S: AsRef<str>, II: IntoIterator<Item = S>>(path: II) -> Self {
8 let path = path.into_iter().map(|s| s.as_ref().to_owned()).collect();
9 Self { path }
10 }
11}