MentionableTop
for tuple
This commit is contained in:
parent
68f8a9ca29
commit
eaa83b1bf0
@ -48,7 +48,7 @@ impl<ErrorA: Error, ErrorB: Error> Error for PairParseError<ErrorA, ErrorB> {}
|
||||
impl<'a, Ctx: Context<'a>, A: MentionableBase<'a, Ctx>, B: MentionableBase<'a, Ctx>>
|
||||
StaticPair<'a, Ctx> for (A, B)
|
||||
where
|
||||
A::Fctr: InliningFactory<'a, Ctx>,
|
||||
A::Fctr: ParseMode,
|
||||
B::Fctr: ParseMode,
|
||||
{
|
||||
type FactoryData = (Self::FA, Self::FB);
|
||||
@ -136,7 +136,7 @@ impl<A: AtomicBase, B: AtomicBase> AtomicBase for (A, B) {
|
||||
type AParseError = PairParseError<A::AParseError, B::AParseError>;
|
||||
}
|
||||
|
||||
impl<A: ParseMode<Mode = InliningMode>, B: ParseMode> ParseMode for (A, B) {
|
||||
impl<A, B: ParseMode> ParseMode for (A, B) {
|
||||
type Mode = B::Mode;
|
||||
}
|
||||
|
||||
@ -164,3 +164,11 @@ impl<'a, Ctx: Context<'a>, FA: InliningFactory<'a, Ctx>, FB: FactoryModeParse<'a
|
||||
PFImpl::<'a, Ctx, FA, FB>::mextend_sp(self, mentionable, tail)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>, B: Mentionable<'a, Ctx>> MentionableTop<'a, Ctx>
|
||||
for (A, B)
|
||||
{
|
||||
fn points_typed(&self, points: &mut impl PointsVisitor<'a, Ctx>) {
|
||||
StaticPairObject::<Self>::points_typed_sp(self, points)
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ pub trait StaticPair<'a, Ctx: Context<'a>>:
|
||||
/// Second element's type. Must equal [`StaticPairSerializable::SB`].
|
||||
type B: MentionableBase<'a, Ctx, Fctr = Self::FB>;
|
||||
/// First element's factory.
|
||||
type FA: FactoryBase<'a, Ctx, Mtbl = Self::A> + InliningFactory<'a, Ctx>;
|
||||
type FA: FactoryBase<'a, Ctx, Mtbl = Self::A> + ParseMode;
|
||||
/// Second element's factory.
|
||||
type FB: FactoryBase<'a, Ctx, Mtbl = Self::B> + ParseMode;
|
||||
/// See [`FactoryBase::ParseError`].
|
||||
@ -171,6 +171,7 @@ impl<'a, Ctx: Context<'a>, SP: StaticPair<'a, Ctx>> ParseMode for StaticPairFact
|
||||
|
||||
impl<'a, Ctx: Context<'a>, SP: StaticPair<'a, Ctx>> StaticPairFactory<'a, Ctx, SP>
|
||||
where
|
||||
SP::FA: InliningFactory<'a, Ctx>,
|
||||
SP::FB: FactoryModeParse<'a, Ctx>,
|
||||
{
|
||||
pub fn mdeserialize_sp<I: InCtx<'a, Ctx>>(
|
||||
@ -207,6 +208,7 @@ where
|
||||
impl<'a, Ctx: Context<'a>, SP: StaticPair<'a, Ctx>> FactoryModeParse<'a, Ctx>
|
||||
for StaticPairFactory<'a, Ctx, SP>
|
||||
where
|
||||
SP::FA: InliningFactory<'a, Ctx>,
|
||||
SP::FB: FactoryModeParse<'a, Ctx>,
|
||||
{
|
||||
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
||||
|
Loading…
Reference in New Issue
Block a user