object_rainbow/impls/
unit.rs

1use crate::*;
2
3impl ToOutput for () {
4    fn to_output(&self, _: &mut dyn Output) {}
5}
6
7impl Topological for () {
8    fn accept_points(&self, _: &mut impl PointVisitor) {}
9}
10
11impl<I: ParseInput> Parse<I> for () {
12    fn parse(input: I) -> crate::Result<Self> {
13        ParseInline::parse_as_inline(input)
14    }
15}
16
17impl<I: ParseInput> ParseInline<I> for () {
18    fn parse_inline(_: &mut I) -> crate::Result<Self> {
19        Ok(())
20    }
21}
22
23impl Tagged for () {}
24
25impl Object for () {}
26
27impl Inline for () {}
28
29impl ReflessObject for () {}
30
31impl ReflessInline for () {}
32
33impl Size for () {
34    const SIZE: usize = 0;
35    type Size = typenum::generic_const_mappings::U<{ Self::SIZE }>;
36}
37
38impl MaybeHasNiche for () {
39    type MnArray = NoNiche<ZeroNoNiche<<Self as Size>::Size>>;
40}