object_rainbow/impls/
tuple1.rs

1use crate::*;
2
3impl<T: ToOutput> ToOutput for (T,) {
4    fn to_output(&self, output: &mut dyn Output) {
5        self.0.to_output(output);
6    }
7}
8
9impl<T: Topological<E>, E: 'static> Topological<E> for (T,) {
10    fn accept_points(&self, visitor: &mut impl PointVisitor<E>) {
11        self.0.accept_points(visitor);
12    }
13}
14
15impl<T: Parse<I>, I: ParseInput> Parse<I> for (T,) {
16    fn parse(input: I) -> crate::Result<Self> {
17        Ok((input.parse()?,))
18    }
19}
20
21impl<T: ParseInline<I>, I: ParseInput> ParseInline<I> for (T,) {
22    fn parse_inline(input: &mut I) -> crate::Result<Self> {
23        Ok((input.parse_inline()?,))
24    }
25}
26
27impl<T: Tagged> Tagged for (T,) {
28    const TAGS: Tags = T::TAGS;
29}
30
31impl<T: Object<E>, E: 'static> Object<E> for (T,) {}
32impl<T: Inline<E>, E: 'static> Inline<E> for (T,) {}
33impl<T: ReflessObject> ReflessObject for (T,) {}
34impl<T: ReflessInline> ReflessInline for (T,) {}
35
36impl<T: Size> Size for (T,) {
37    const SIZE: usize = T::SIZE;
38    type Size = T::Size;
39}
40
41impl<T: MaybeHasNiche> MaybeHasNiche for (T,) {
42    type MnArray = T::MnArray;
43}
44
45impl<T> Equivalent<T> for (T,) {
46    fn into_equivalent(self) -> T {
47        self.0
48    }
49
50    fn from_equivalent(object: T) -> Self {
51        (object,)
52    }
53}