1use crate::*;
2
3pub mod array;
4pub mod fetch_extra;
5
6#[derive(Debug, Clone, ParseAsInline, PartialEq)]
7pub struct Extras<Extra>(pub Extra);
8
9impl<Extra> Deref for Extras<Extra> {
10 type Target = Extra;
11
12 fn deref(&self) -> &Self::Target {
13 &self.0
14 }
15}
16
17impl<Extra> ToOutput for Extras<Extra> {
18 fn to_output(&self, _: &mut (impl ?Sized + Output)) {}
19}
20
21impl<Extra> InlineOutput for Extras<Extra> {}
22
23impl<I: PointInput> ParseInline<I> for Extras<I::Extra> {
24 fn parse_inline(input: &mut I) -> object_rainbow::Result<Self> {
25 Ok(Self(input.extra().clone()))
26 }
27}
28
29impl<Extra> Tagged for Extras<Extra> {}
30impl<Extra> ListHashes for Extras<Extra> {}
31impl<Extra> Topological for Extras<Extra> {}
32
33impl<Extra> CanonicalExtra for Extras<Extra> {
34 type Extra = Extra;
35}
36
37impl<Extra: Clone> ToCanonicalExtra for Extras<Extra> {
38 fn canonical_extra(&self) -> Self::Extra {
39 self.0.clone()
40 }
41}
42
43impl<Extra> Size for Extras<Extra> {
44 type Size = typenum::U0;
45 const SIZE: usize = 0;
46}
47
48impl<Extra> MaybeHasNiche for Extras<Extra> {
49 type MnArray = NoNiche<ZeroNoNiche<<Self as Size>::Size>>;
50}