-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust server: support for trait method that intercepts requests (use c…
…ase: auth) * The handler trait gets an additional method `intercept_handler_pre(&self, &req, ctx)` * `ctx` is an associated type of the handler trait * `ctx`'s role is to store data extracted by the interceptor Check out the newly added example `humblegen/tests/rust/service-authorization-using-interceptor`. - [ ] Problem: I do not know how I should deal with this warning: ``` WARNINGS: ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ warning: the trait `protocol::BlogApi` cannot be made into an object --> $DIR/spec.rs:100:14 | 98 | pub trait BlogApi { | ------- this trait cannot be made into an object... 99 | type Context: Default + Sized + Send + Sync; 100 | async fn intercept_handler_pre( | ^^^^^^^^^^^^^^^^^^^^^ ...because method `intercept_handler_pre` references the `Self` type in its `where` clause | = note: `#[warn(where_clauses_object_safety)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #51443 <rust-lang/rust#51443> = help: consider moving `intercept_handler_pre` to another trait ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ``` ISTM that it is related to `async-trait` because it goes away if we remove the `async` in front of the `async fn intercept_handler_pre` decl.
- Loading branch information
Showing
8 changed files
with
551 additions
and
56 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.