object_rainbow/impls/
tuple1.rs1use 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: InlineOutput> InlineOutput for (T,) {}
10
11impl<T: ListHashes> ListHashes for (T,) {
12 fn list_hashes(&self, f: &mut impl FnMut(Hash)) {
13 self.0.list_hashes(f);
14 }
15
16 fn topology_hash(&self) -> Hash {
17 self.0.topology_hash()
18 }
19
20 fn point_count(&self) -> usize {
21 self.0.point_count()
22 }
23}
24
25impl<T: Topological> Topological for (T,) {
26 fn traverse(&self, visitor: &mut impl PointVisitor) {
27 self.0.traverse(visitor);
28 }
29}
30
31impl<T: Parse<I>, I: ParseInput> Parse<I> for (T,) {
32 fn parse(input: I) -> crate::Result<Self> {
33 Ok((input.parse()?,))
34 }
35}
36
37impl<T: ParseInline<I>, I: ParseInput> ParseInline<I> for (T,) {
38 fn parse_inline(input: &mut I) -> crate::Result<Self> {
39 Ok((input.parse_inline()?,))
40 }
41}
42
43impl<T: Tagged> Tagged for (T,) {
44 const TAGS: Tags = T::TAGS;
45}
46
47impl<T: Size> Size for (T,) {
48 const SIZE: usize = T::SIZE;
49 type Size = T::Size;
50}
51
52impl<T: MaybeHasNiche> MaybeHasNiche for (T,) {
53 type MnArray = T::MnArray;
54}
55
56impl<T> Equivalent<T> for (T,) {
57 fn into_equivalent(self) -> T {
58 self.0
59 }
60
61 fn from_equivalent(object: T) -> Self {
62 (object,)
63 }
64}