object_rainbow/impls/
unit.rs

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