mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Move FromRequest and IntoResponse into new axum-core crate (#564)
* Move `IntoResponse` to axum-core * Move `FromRequest` to axum-core * some clean up * Remove hyper dependency from axum-core * Fix docs reference * Use default * Update changelog * Remove mention of default type
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
error[E0277]: the trait bound `bool: FromRequest` is not satisfied
|
||||
error[E0277]: the trait bound `bool: FromRequest<Body>` is not satisfied
|
||||
--> tests/fail/argument_not_extractor.rs:4:23
|
||||
|
|
||||
4 | async fn handler(foo: bool) {}
|
||||
| ^^^^ the trait `FromRequest` is not implemented for `bool`
|
||||
| ^^^^ the trait `FromRequest<Body>` is not implemented for `bool`
|
||||
|
|
||||
= help: see issue #48214
|
||||
|
||||
@@ -7,10 +7,13 @@ use axum_debug::debug_handler;
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl FromRequest for A {
|
||||
impl<B> FromRequest<B> for A
|
||||
where
|
||||
B: Send + 'static,
|
||||
{
|
||||
type Rejection = ();
|
||||
|
||||
async fn from_request(_req: &mut RequestParts) -> Result<Self, Self::Rejection> {
|
||||
async fn from_request(_req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: Handlers must only take owned values
|
||||
--> tests/fail/extract_self_mut.rs:20:22
|
||||
--> tests/fail/extract_self_mut.rs:23:22
|
||||
|
|
||||
20 | async fn handler(&mut self) {}
|
||||
23 | async fn handler(&mut self) {}
|
||||
| ^^^^^^^^^
|
||||
|
||||
@@ -7,10 +7,13 @@ use axum_debug::debug_handler;
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl FromRequest for A {
|
||||
impl<B> FromRequest<B> for A
|
||||
where
|
||||
B: Send + 'static,
|
||||
{
|
||||
type Rejection = ();
|
||||
|
||||
async fn from_request(_req: &mut RequestParts) -> Result<Self, Self::Rejection> {
|
||||
async fn from_request(_req: &mut RequestParts<B>) -> Result<Self, Self::Rejection> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: Handlers must only take owned values
|
||||
--> tests/fail/extract_self_ref.rs:20:22
|
||||
--> tests/fail/extract_self_ref.rs:23:22
|
||||
|
|
||||
20 | async fn handler(&self) {}
|
||||
23 | async fn handler(&self) {}
|
||||
| ^^^^^
|
||||
|
||||
Reference in New Issue
Block a user