AParseResultM -> AModeResultM

This commit is contained in:
AF 2023-07-30 15:21:19 +00:00
parent 9d9c86033a
commit 7644bbc14c
3 changed files with 10 additions and 7 deletions

View File

@ -15,7 +15,7 @@ use crate::rcore::*;
use super::*;
pub use self::modes::{
AExtensionResultM, AExtensionSourceM, AParseResultM, AtomicModeParse, AtomicModeProxy,
AExtensionResultM, AExtensionSourceM, AModeResultM, AtomicModeParse, AtomicModeProxy,
RegularAtomic,
};

View File

@ -10,14 +10,17 @@ impl<A: AtomicModeParse> Atomic for A {
}
}
pub type AParseResultM<A, I> = ModeResultP<A, A, AParseError<A>, I>;
/// [`Atomic`] equivalent of [`ModeResult`].
pub type AModeResultM<A, I> = ModeResultP<A, A, AParseError<A>, I>;
/// [`Atomic`] equivalent of [`ExtensionResult`].
pub type AExtensionResultM<A> = ExtensionResultP<A, A, AParseError<A>>;
/// [`Atomic`] equivalent of [`ExtensionSource`].
pub type AExtensionSourceM<A> = ExtensionSourceP<A, A>;
pub trait AtomicModeParse: AtomicBase + ParseMode {
fn ma_deserialize<I: Inlining>(inlining: I) -> AParseResultM<Self, I>;
fn ma_deserialize<I: Inlining>(inlining: I) -> AModeResultM<Self, I>;
fn ma_extend(atomic: AExtensionSourceM<Self>, tail: &[u8]) -> AExtensionResultM<Self>;
}
@ -25,7 +28,7 @@ pub trait AtomicModeParse: AtomicBase + ParseMode {
pub trait AtomicModeProxy {
type A: AtomicBase + ParseMode;
fn pma_deserialize<I: Inlining>(inlining: I) -> AParseResultM<Self::A, I>;
fn pma_deserialize<I: Inlining>(inlining: I) -> AModeResultM<Self::A, I>;
fn pma_extend(atomic: AExtensionSourceM<Self::A>, tail: &[u8]) -> AExtensionResultM<Self::A>;
}
@ -34,7 +37,7 @@ impl<A: AtomicBase + WithParseMode> AtomicModeParse for A
where
<A as WithParseMode>::WithMode: AtomicModeProxy<A = A>,
{
fn ma_deserialize<I: Inlining>(inlining: I) -> AParseResultM<Self, I> {
fn ma_deserialize<I: Inlining>(inlining: I) -> AModeResultM<Self, I> {
<<A as WithParseMode>::WithMode as AtomicModeProxy>::pma_deserialize(inlining)
}
@ -51,7 +54,7 @@ pub trait RegularAtomic: AtomicBase + ParseMode<Mode = RegularMode> {
impl<A: RegularAtomic> AtomicModeProxy for WithMode<A, RegularMode> {
type A = A;
fn pma_deserialize<I: Inlining>(inlining: I) -> AParseResultM<Self::A, I> {
fn pma_deserialize<I: Inlining>(inlining: I) -> AModeResultM<Self::A, I> {
A::ra_deserialize(inlining)
}

View File

@ -87,7 +87,7 @@ impl<'a, Ctx: Context<'a>, F: QInliningFactory<'a, Ctx>> FactoryModeProxy<'a, Ct
impl<A: QInliningAtomic> AtomicModeProxy for WithMode<A, InliningMode> {
type A = A;
fn pma_deserialize<I: Inlining>(inlining: I) -> AParseResultM<Self::A, I> {
fn pma_deserialize<I: Inlining>(inlining: I) -> AModeResultM<Self::A, I> {
A::qa_ideserialize(inlining)
}