async fn get_current_user(
req: HttpRequest,
payload: &mut Payload,
config: &CurrentUserConfig,
) -> Result<CurrentUser, Error> {
todo!()
}
#[derive(Debug)]
pub struct CurrentUser(User);
impl FromRequest for CurrentUser {
type Error = Error;
type Future = impl Future<Output = Result<Self, Self::Error>>;
#[inline]
fn from_request(req: &HttpRequest, payload: &mut Payload) -> Self::Future {
let config = CurrentUserConfig::from_req(req);
get_current_user(req.clone(), payload, config)
}
}
The above code does not work properly because 'impl Trait' in type aliases is unstable
,
what type of Future
should I set
........................