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>>
|
impl<'a, Ctx: Context<'a>, A: MentionableBase<'a, Ctx>, B: MentionableBase<'a, Ctx>>
|
||||||
StaticPair<'a, Ctx> for (A, B)
|
StaticPair<'a, Ctx> for (A, B)
|
||||||
where
|
where
|
||||||
A::Fctr: InliningFactory<'a, Ctx>,
|
A::Fctr: ParseMode,
|
||||||
B::Fctr: ParseMode,
|
B::Fctr: ParseMode,
|
||||||
{
|
{
|
||||||
type FactoryData = (Self::FA, Self::FB);
|
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>;
|
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;
|
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)
|
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`].
|
/// Second element's type. Must equal [`StaticPairSerializable::SB`].
|
||||||
type B: MentionableBase<'a, Ctx, Fctr = Self::FB>;
|
type B: MentionableBase<'a, Ctx, Fctr = Self::FB>;
|
||||||
/// First element's factory.
|
/// 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.
|
/// Second element's factory.
|
||||||
type FB: FactoryBase<'a, Ctx, Mtbl = Self::B> + ParseMode;
|
type FB: FactoryBase<'a, Ctx, Mtbl = Self::B> + ParseMode;
|
||||||
/// See [`FactoryBase::ParseError`].
|
/// 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>
|
impl<'a, Ctx: Context<'a>, SP: StaticPair<'a, Ctx>> StaticPairFactory<'a, Ctx, SP>
|
||||||
where
|
where
|
||||||
|
SP::FA: InliningFactory<'a, Ctx>,
|
||||||
SP::FB: FactoryModeParse<'a, Ctx>,
|
SP::FB: FactoryModeParse<'a, Ctx>,
|
||||||
{
|
{
|
||||||
pub fn mdeserialize_sp<I: InCtx<'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>
|
impl<'a, Ctx: Context<'a>, SP: StaticPair<'a, Ctx>> FactoryModeParse<'a, Ctx>
|
||||||
for StaticPairFactory<'a, Ctx, SP>
|
for StaticPairFactory<'a, Ctx, SP>
|
||||||
where
|
where
|
||||||
|
SP::FA: InliningFactory<'a, Ctx>,
|
||||||
SP::FB: FactoryModeParse<'a, Ctx>,
|
SP::FB: FactoryModeParse<'a, Ctx>,
|
||||||
{
|
{
|
||||||
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
||||||
|
Loading…
Reference in New Issue
Block a user