All Matrix endpoint errors should use the same format in theory, and this type supports other response error formats anyway.
47 lines
2.1 KiB
Text
47 lines
2.1 KiB
Text
error: Use `#[ruma_api(body)]` to represent the JSON body as a single field
|
|
--> tests/it/api/ui/serde-flatten-response-body.rs:28:5
|
|
|
|
|
28 | / #[serde(flatten)]
|
|
29 | | pub foo: CustomResponseBody,
|
|
| |_______________________________^
|
|
|
|
error[E0277]: the trait bound `Response: IncomingResponse` is not satisfied
|
|
--> tests/it/api/ui/serde-flatten-response-body.rs:23:1
|
|
|
|
|
23 | #[request]
|
|
| ^^^^^^^^^^ unsatisfied trait bound
|
|
|
|
|
help: the trait `IncomingResponse` is not implemented for `Response`
|
|
--> tests/it/api/ui/serde-flatten-response-body.rs:27:1
|
|
|
|
|
27 | pub struct Response {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
note: required by a bound in `ruma_common::api::OutgoingRequest::IncomingResponse`
|
|
--> src/api.rs
|
|
|
|
|
| type IncomingResponse: IncomingResponse<EndpointError = Self::EndpointError>;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `OutgoingRequest::IncomingResponse`
|
|
= note: this error originates in the derive macro `::ruma_common::exports::ruma_macros::Request` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error[E0277]: the trait bound `Response: OutgoingResponse` is not satisfied
|
|
--> tests/it/api/ui/serde-flatten-response-body.rs:23:1
|
|
|
|
|
23 | #[request]
|
|
| ^^^^^^^^^^ unsatisfied trait bound
|
|
|
|
|
help: the trait `OutgoingResponse` is not implemented for `Response`
|
|
--> tests/it/api/ui/serde-flatten-response-body.rs:27:1
|
|
|
|
|
27 | pub struct Response {
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
help: the trait `OutgoingResponse` is implemented for `ruma_common::api::error::Error`
|
|
--> src/api/error.rs
|
|
|
|
|
| impl OutgoingResponse for Error {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: required by a bound in `ruma_common::api::IncomingRequest::OutgoingResponse`
|
|
--> src/api.rs
|
|
|
|
|
| type OutgoingResponse: OutgoingResponse;
|
|
| ^^^^^^^^^^^^^^^^ required by this bound in `IncomingRequest::OutgoingResponse`
|
|
= note: this error originates in the derive macro `::ruma_common::exports::ruma_macros::Request` (in Nightly builds, run with -Z macro-backtrace for more info)
|