FactoryModeParse for pair
All checks were successful
buildbot/fmt-check Build done.
buildbot/clippy Build done.
buildbot/runtests Build done.
buildbot/rustdoc Build done.

This commit is contained in:
AF 2023-08-05 13:15:42 +00:00
parent eb9a35f367
commit 68f8a9ca29

View File

@ -139,3 +139,28 @@ impl<A: AtomicBase, B: AtomicBase> AtomicBase for (A, B) {
impl<A: ParseMode<Mode = InliningMode>, B: ParseMode> ParseMode for (A, B) {
type Mode = B::Mode;
}
type PFImpl<'a, Ctx, FA, FB> = StaticPairFactory<
'a,
Ctx,
(
<FA as FactoryBase<'a, Ctx>>::Mtbl,
<FB as FactoryBase<'a, Ctx>>::Mtbl,
),
>;
impl<'a, Ctx: Context<'a>, FA: InliningFactory<'a, Ctx>, FB: FactoryModeParse<'a, Ctx>>
FactoryModeParse<'a, Ctx> for (FA, FB)
{
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
PFImpl::<'a, Ctx, FA, FB>::mdeserialize_sp(self, inctx)
}
fn mextend(
&self,
mentionable: ExtensionSourceM<'a, Ctx, Self>,
tail: &[u8],
) -> ExtensionResultM<'a, Ctx, Self> {
PFImpl::<'a, Ctx, FA, FB>::mextend_sp(self, mentionable, tail)
}
}