fallible docs

This commit is contained in:
AF 2023-04-24 23:24:09 +00:00
parent d465d06895
commit f776bf05ca
4 changed files with 8 additions and 4 deletions

View File

@ -80,7 +80,7 @@ pub trait Mentionable<'a, Ctx: 'a + Context>: 'a + Serializable {
} }
} }
/// Short-hand 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> = pub type ParseResult<'a, Ctx, F> =
Result<<F as Factory<'a, Ctx>>::Mtbl, <F as Factory<'a, Ctx>>::ParseError>; Result<<F as Factory<'a, Ctx>>::Mtbl, <F as Factory<'a, Ctx>>::ParseError>;

View File

@ -21,7 +21,7 @@ pub type ResolutionResult<'a, Ctx, A> = Result<Rc<A>, ResolutionFailure<'a, Ctx,
/// Wrapped result returned by [`Origin`]. /// Wrapped result returned by [`Origin`].
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>>;
/// Short-hand 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< pub type HashResolution<'a, Ctx> = Wrapped<
'a, 'a,
Ctx, Ctx,

View File

@ -87,9 +87,9 @@ impl<'a, Ctx: 'a + Context, A: Atomic> Factory<'a, Ctx> for AtomicFactory<A> {
/// Extension trait to provide method-like utilities associated with [AtomicObject]s. /// Extension trait to provide method-like utilities associated with [AtomicObject]s.
pub trait ExtAtomicObject: Atomic { pub trait ExtAtomicObject: Atomic {
/// Short-hand for getting specific [`AtomicFactory`]. /// Shorthand for getting specific [`AtomicFactory`].
fn f() -> AtomicFactory<Self>; fn f() -> AtomicFactory<Self>;
/// Short-hand for getting specific [`AtomicObject`]. /// Shorthand for getting specific [`AtomicObject`].
fn m(self) -> AtomicObject<Self>; fn m(self) -> AtomicObject<Self>;
} }

View File

@ -1,5 +1,9 @@
//! Shorthands for using [`Context::Fallible`].
use super::*; use super::*;
/// Preferred monad for fallible uses.
pub type FallibleMonad<Ctx, E> = <<Ctx as Context>::Fallible as MonadFailAny>::W<E>; pub type FallibleMonad<Ctx, E> = <<Ctx as Context>::Fallible as MonadFailAny>::W<E>;
/// Preferred [Wrapped] [Result].
pub type FallibleWrapped<'a, Ctx, A, E> = <FallibleMonad<Ctx, E> as WeakFunctor>::F<'a, A>; pub type FallibleWrapped<'a, Ctx, A, E> = <FallibleMonad<Ctx, E> as WeakFunctor>::F<'a, A>;