Mtbl docs

This commit is contained in:
AF 2023-07-01 00:55:48 +00:00
parent 237128d994
commit 28478ce7db

View File

@ -66,7 +66,7 @@ pub type Fctr<'a, Ctx, A> = <A as Mentionable<'a, Ctx>>::Fctr;
/// Shorthand for the type of vaalues returned by [`Factory::deserialize`]. /// Shorthand for the type of vaalues returned by [`Factory::deserialize`].
pub type ParseResult<'a, Ctx, F> = Result<Mtbl<'a, Ctx, F>, <F as Factory<'a, Ctx>>::ParseError>; pub type ParseResult<'a, Ctx, F> = Result<Mtbl<'a, Ctx, F>, <F as Factory<'a, Ctx>>::ParseError>;
/// [`ParseResult`] associated with a [Mentionable] (instead of a [Factory]). /// [`ParseResult`] associated with a [`Mentionable`] (instead of a [`Factory`]).
pub type ParseResultA<'a, Ctx, A> = Result<A, ParseErrorA<'a, Ctx, A>>; pub type ParseResultA<'a, Ctx, A> = Result<A, ParseErrorA<'a, Ctx, A>>;
/// Trait representing deserialisation rules for [Mentionable]s. /// Trait representing deserialisation rules for [Mentionable]s.
@ -83,6 +83,7 @@ pub trait Factory<'a, Ctx: Context<'a>>: 'a + Send + Sync + Clone {
fn extend(&self, mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self>; fn extend(&self, mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self>;
} }
/// [`Mentionable`] associated with the [`Factory`]. Mostly useful for `type` definitions.
pub type Mtbl<'a, Ctx, F> = <F as Factory<'a, Ctx>>::Mtbl; pub type Mtbl<'a, Ctx, F> = <F as Factory<'a, Ctx>>::Mtbl;
pub type ParseError<'a, Ctx, F> = <F as Factory<'a, Ctx>>::ParseError; pub type ParseError<'a, Ctx, F> = <F as Factory<'a, Ctx>>::ParseError;