object-rainbow 0.0.0-a.58

distributed object model
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{map_extra::MapExtra, *};

/// Parses `Extra`, then provides it to `T`'s parser.
#[derive(
    Debug, ToOutput, InlineOutput, Tagged, ListHashes, Topological, Clone, Copy, Parse, ParseInline,
)]
pub struct InlineExtra<Extra = ()>(pub Extra);

impl<E: 'static + Clone, X: 'static + Clone> MapExtra<X> for InlineExtra<E> {
    type Mapped = (E, X);

    fn map_extra(&self, extra: X) -> Self::Mapped {
        (self.0.clone(), extra)
    }
}