1use crate::types::{Name, Typed, TypedNames};
4use std::ops::Deref;
5
6#[derive(Debug, Clone, Eq, PartialEq, Default)]
11pub struct Objects(TypedNames);
12
13impl Objects {
14 pub fn new<I: IntoIterator<Item = Typed<Name>>>(objects: I) -> Self {
16 Self(objects.into_iter().collect())
17 }
18
19 pub fn values(&self) -> &TypedNames {
20 &self.0
21 }
22}
23
24impl From<TypedNames> for Objects {
25 fn from(value: TypedNames) -> Self {
26 Self(value)
27 }
28}
29
30impl FromIterator<Typed<Name>> for Objects {
31 fn from_iter<T: IntoIterator<Item = Typed<Name>>>(iter: T) -> Self {
32 Objects::new(TypedNames::from_iter(iter))
33 }
34}
35
36impl Deref for Objects {
37 type Target = TypedNames;
38
39 #[inline(always)]
40 fn deref(&self) -> &Self::Target {
41 &self.0
42 }
43}