Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error[E0308]: mismatched types
- --> src/handler.rs:88:46
- |
- 88 | Err((StatusCode::NOT_FOUND, Json("Record not found")))
- | ---- ^^^^^^^^^^^^^^^^^^ expected `Value`, found `&str`
- | |
- | arguments to this struct are incorrect
- |
- help: the type constructed contains `&'static str` due to the type of the argument passed
- --> src/handler.rs:88:41
- |
- 88 | Err((StatusCode::NOT_FOUND, Json("Record not found")))
- | ^^^^^------------------^
- | |
- | this argument influences the type of `Json`
- note: tuple struct defined here
- --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.6.12/src/json.rs:101:12
- |
- 101 | pub struct Json<T>(pub T);
- | ^^^^
- help: call `Into::into` on this expression to convert `&'static str` into `JsonValue`
- |
- 88 | Err((StatusCode::NOT_FOUND, Json("Record not found".into())))
- | +++++++
- error[E0308]: mismatched types
- --> src/handler.rs:93:58
- |
- 93 | Err((StatusCode::INTERNAL_SERVER_ERROR, Json("Internal server error")))
- | ---- ^^^^^^^^^^^^^^^^^^^^^^^ expected `Value`, found `&str`
- | |
- | arguments to this struct are incorrect
- |
- help: the type constructed contains `&'static str` due to the type of the argument passed
- --> src/handler.rs:93:53
- |
- 93 | Err((StatusCode::INTERNAL_SERVER_ERROR, Json("Internal server error")))
- | ^^^^^-----------------------^
- | |
- | this argument influences the type of `Json`
- note: tuple struct defined here
- --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.6.12/src/json.rs:101:12
- |
- 101 | pub struct Json<T>(pub T);
- | ^^^^
- help: call `Into::into` on this expression to convert `&'static str` into `JsonValue`
- |
- 93 | Err((StatusCode::INTERNAL_SERVER_ERROR, Json("Internal server error".into())))
- | +++++++
- error[E0277]: the trait bound `fn(axum::extract::Path<i64>, axum::extract::State<Arc<AppState>>) -> impl std::future::Future<Output = Result<impl IntoResponse, (axum::http::StatusCode, axum::Json<JsonValue>)>> {comments_list_handler}: Handler<_, _, _>` is not satisfied
- --> src/route.rs:20:42
- |
- 20 | .route("/observaciones/:id", get(comments_list_handler))
- | --- ^^^^^^^^^^^^^^^^^^^^^ the trait `Handler<_, _, _>` is not implemented for fn item `fn(axum::extract::Path<i64>, axum::extract::State<Arc<AppState>>) -> impl std::future::Future<Output = Result<impl IntoResponse, (axum::http::StatusCode, axum::Json<JsonValue>)>> {comments_list_handler}`
- | |
- | required by a bound introduced by this call
- |
- = help: the following other types implement trait `Handler<T, S, B>`:
- <Layered<L, H, T, S, B, B2> as Handler<T, S, B2>>
- <MethodRouter<S, B> as Handler<(), S, B>>
- note: required by a bound in `axum::routing::get`
- --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.6.12/src/routing/method_routing.rs:403:1
- |
- 403 | top_level_handler_fn!(get, GET);
- | ^^^^^^^^^^^^^^^^^^^^^^---^^^^^^
- | | |
- | | required by a bound in this function
- | required by this bound in `get`
- = note: this error originates in the macro `top_level_handler_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
- Some errors have detailed explanations: E0277, E0308.
- For more information about an error, try `rustc --explain E0277`.
- error: could not compile `rust-axum-postgres-api` (bin "rust-axum-postgres-api") due to 3 previous errors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement