solomon_gremlin/structure/
set.rs

1use crate::GValue;
2use std::vec::IntoIter;
3
4// pub type Set = Vec<GValue>;
5
6#[derive(Debug, PartialEq, Clone)]
7pub struct Set(Vec<GValue>);
8
9impl Set {
10	pub(crate) fn take(self) -> Vec<GValue> {
11		self.0
12	}
13
14	pub fn iter(&self) -> impl Iterator<Item = &GValue> {
15		self.0.iter()
16	}
17}
18
19impl Into<Set> for Vec<GValue> {
20	fn into(self) -> Set {
21		Set(self)
22	}
23}
24
25impl From<Set> for Vec<GValue> {
26	fn from(set: Set) -> Self {
27		set.take()
28	}
29}
30
31impl IntoIterator for Set {
32	type Item = GValue;
33	type IntoIter = IntoIter<GValue>;
34	fn into_iter(self) -> Self::IntoIter {
35		self.0.into_iter()
36	}
37}