object_rainbow/impls/
refs.rs1use crate::*;
2
3impl<T: ?Sized + ToOutput> ToOutput for &T {
4 fn to_output(&self, output: &mut (impl ?Sized + Output)) {
5 (**self).to_output(output);
6 }
7}
8
9impl<T: ?Sized + InlineOutput> InlineOutput for &T {}
10
11impl<T: ?Sized + ListHashes> ListHashes for &T {
12 fn list_hashes(&self, f: &mut (impl ?Sized + FnMut(Hash))) {
13 (**self).list_hashes(f);
14 }
15
16 fn topology_hash(&self) -> Hash {
17 (**self).topology_hash()
18 }
19
20 fn point_count(&self) -> usize {
21 (**self).point_count()
22 }
23}
24
25impl<T: ?Sized + Tagged> Tagged for &T {
26 const TAGS: Tags = T::TAGS;
27 const HASH: Hash = T::HASH;
28}
29
30impl<T: ?Sized + Topological> Topological for &T {
31 fn traverse(&self, visitor: &mut (impl ?Sized + PointVisitor)) {
32 (**self).traverse(visitor);
33 }
34}
35
36impl<T: ?Sized + ByteOrd> ByteOrd for &T {
37 fn bytes_cmp(&self, other: &Self) -> std::cmp::Ordering {
38 (**self).bytes_cmp(other)
39 }
40}
41
42impl<T: ?Sized + Size> Size for &T {
43 type Size = T::Size;
44}
45
46impl<T: ?Sized + MaybeHasNiche> MaybeHasNiche for &T {
47 type MnArray = T::MnArray;
48}
49
50impl<T: ?Sized + Output> Output for &mut T {
51 fn write(&mut self, data: &[u8]) {
52 (**self).write(data);
53 }
54}
55
56impl<T: ?Sized + PointVisitor> PointVisitor for &mut T {
57 fn visit(&mut self, point: &(impl 'static + SingularFetch<T: Traversible> + Clone)) {
58 (**self).visit(point);
59 }
60}