Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running into not all trait items implemented, missing: Body`` in latest axum #1905

Closed
1 task done
IanQS opened this issue Apr 1, 2023 · 0 comments
Closed
1 task done

Comments

@IanQS
Copy link

IanQS commented Apr 1, 2023

  • I have looked for existing issues (including closed) about this

The closest thing I could find was Support generating OpenAPI/Swagger docs where the user discussed RequestBody, but that's definitely not particularly relevant.

Bug Report

Version

My dependencies are

axum = "0.6.12"
tokio = { version = "1.27.0", features = ["full"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "any", "postgres"] }

as I've got in my Cargo.toml

Platform

MacOS M1 2021 model

Description

When trying the example code listed in sqlx-postgres (but with the crate versions listed above) I get

error[E0046]: not all trait items implemented, missing: `Body`
   --> /Users/ianqs/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-core-0.3.3/src/macros.rs:72:9
    |
72  |           impl $crate::response::IntoResponse for $name {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Body` in implementation
    |
   ::: /Users/ianqs/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-core-0.3.3/src/response/into_response.rs:129:5
    |
129 |       type Body;
    |       --------- `Body` from trait
    |
   ::: /Users/ianqs/.cargo/registry/src/github.com-1ecc6299db9ec823/axum-core-0.3.3/src/extract/rejection.rs:5:1
    |
5   | / composite_rejection! {
6   | |     /// Rejection type for extractors that buffer the request body. Used if the
7   | |     /// request body cannot be buffered due to an error.
8   | |     pub enum FailedToBufferBody {
...   |
11  | |     }
12  | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `composite_rejection` (in Nightly builds, run with -Z macro-backtrace for more info)

Sorry, I know this is a silly question given I'm using a completely different version, but I've tried googling this specific error around and couldn't find anything that was useful. I'm new-ish to Rust and I can't tell what exactly I need to implement for what structure - the code seems relatively uncomplicated so...?

@tokio-rs tokio-rs locked and limited conversation to collaborators Apr 1, 2023
@davidpdrsn davidpdrsn converted this issue into discussion #1906 Apr 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant