LookupError type

This commit is contained in:
AF 2023-06-19 13:23:58 +00:00
parent 673ab92662
commit de26092abc

View File

@ -18,9 +18,11 @@ impl<L, P> ResolutionError<L, P> {
} }
} }
pub type LookupError<'a, Ctx> = <Ctx as Context<'a>>::LookupError;
/// See [`ResolutionResult`]. /// See [`ResolutionResult`].
pub type ResolutionFailure<'a, Ctx, A> = pub type ResolutionFailure<'a, Ctx, A> =
ResolutionError<<Ctx as Context<'a>>::LookupError, ParseErrorA<'a, Ctx, A>>; ResolutionError<LookupError<'a, Ctx>, ParseErrorA<'a, Ctx, A>>;
/// Result yielded by [`Origin`]. /// Result yielded by [`Origin`].
pub type ResolutionResult<'a, Ctx, A> = Result<Rc<A>, ResolutionFailure<'a, Ctx, A>>; pub type ResolutionResult<'a, Ctx, A> = Result<Rc<A>, ResolutionFailure<'a, Ctx, A>>;
@ -29,7 +31,7 @@ pub type ResolutionResult<'a, Ctx, A> = Result<Rc<A>, ResolutionFailure<'a, Ctx,
pub type Resolution<'a, Ctx, A> = Wrapped<'a, Ctx, ResolutionResult<'a, Ctx, A>>; pub type Resolution<'a, Ctx, A> = Wrapped<'a, Ctx, ResolutionResult<'a, Ctx, A>>;
pub type HashResolutionResult<'a, Ctx> = pub type HashResolutionResult<'a, Ctx> =
Result<(Vec<u8>, Rc<dyn Resolver<'a, Ctx>>), <Ctx as Context<'a>>::LookupError>; Result<(Vec<u8>, Rc<dyn Resolver<'a, Ctx>>), LookupError<'a, Ctx>>;
/// Shorthand for the type of values returned by [`Resolver::resolve`]. /// Shorthand for the type of values returned by [`Resolver::resolve`].
pub type HashResolution<'a, Ctx> = Wrapped<'a, Ctx, HashResolutionResult<'a, Ctx>>; pub type HashResolution<'a, Ctx> = Wrapped<'a, Ctx, HashResolutionResult<'a, Ctx>>;