#![allow(async_fn_in_trait)]
pub trait Resolve: Sized {
type Context: ?Sized;
type Output;
type Error;
async fn resolve_in_context(self, ctx: &Self::Context) -> Result<Self::Output, Self::Error>;
async fn resolve(self) -> Result<Self::Output, Self::Error>
where
Self::Context: From<()>,
{
self.resolve_in_context(&().into()).await
}
}
pub trait ResolveFrom<Raw>: Sized {
type Context: ?Sized;
type Error;
async fn resolve_from_in_context(raw: Raw, ctx: &Self::Context) -> Result<Self, Self::Error>;
async fn resolve_from(raw: Raw) -> Result<Self, Self::Error>
where
Self::Context: From<()>,
{
Self::resolve_from_in_context(raw, &().into()).await
}
}