Skip to content
Discussion options

You must be logged in to vote

Your problem is T: Yokeable<'a, Output = T>, the T type and the output types are different types (they are the same types with different lifetimes).

When you have a Yoke<T>, T is always the 'static version of the type, and the Output is the borrowed version.

use axum::{Router, extract::FromRequest, routing::get};
use serde::Deserialize;
use yoke::{Yoke, Yokeable};

#[derive(Yokeable, Deserialize)]
pub struct Request<'a> {
    data: &'a str,
}

pub struct Extractor<T>(Yoke<T, Vec<u8>>) where for<'a> T: Yokeable<'a>;

impl<T, S> FromRequest<S> for Extractor<T>
where
    S: Send + Sync,
    for<'a> T: Yokeable<'a>,
    for<'a> <T as Yokeable<'a>>::Output: Deserialize<'a>
{
    type Rejection = 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 1xX69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants