add state parameter to router

This commit is contained in:
David Pedersen
2022-07-03 00:44:19 +02:00
parent 7ed35d2b5f
commit 43169f96cd
30 changed files with 468 additions and 257 deletions
+16
View File
@@ -272,3 +272,19 @@ where
Ok(T::from_request(req).await)
}
}
/// TODO(david): docs
#[derive(Clone, Copy, Debug, Default)]
pub struct State<S>(pub S);
#[async_trait]
impl<S, B> FromRequest<B> for State<S>
where
B: Send,
{
type Rejection = Infallible;
async fn from_request(req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
todo!()
}
}