Merge branch 'master' into fix-clippy-warning

This commit is contained in:
sheshnath 2024-08-21 13:01:54 +05:30 committed by GitHub
commit 444c6a5b81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
67 changed files with 2089 additions and 1060 deletions

View File

@ -66,8 +66,8 @@ jobs:
- name: Install Native Dependencies (macOS)
if: matrix.platform.name == 'macOS'
run: |
brew install mysql-client libpq sqlite coreutils
brew link --force --overwrite mysql-client
brew install mysql-client@8.4 libpq sqlite coreutils
brew link --force --overwrite mysql-client@8.4
brew link --force --overwrite libpq
echo "/usr/local/opt/mysql-client/bin" >> "$GITHUB_PATH"
@ -76,13 +76,14 @@ jobs:
- name: Install Native Dependencies (Windows)
if: matrix.platform.name == 'Windows'
run: |
curl -fsLS -o vcpkg.7z https://blob.rocket.rs/vcpkg-2019-07-05.7z
curl -fsLS -o vcpkg.7z https://blob.rocket.rs/vcpkg-2024-08-16.7z
7z x vcpkg.7z -y -bb0
xcopy .\vcpkg $env:VCPKG_INSTALLATION_ROOT /s /e /h /y /q
vcpkg integrate install
echo "VCPKGRS_DYNAMIC=1" >> "$env:GITHUB_ENV"
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> "$env:GITHUB_ENV"
echo "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" >> "$env:GITHUB_PATH"
echo "MYSQLCLIENT_VERSION=8.0.39" >> "$env:GITHUB_ENV"
- name: Install NASM (Windows)
if: matrix.platform.name == 'Windows'

563
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,563 @@
# Contributing to Rocket
**Please read this document before contributing!**
Thank you for contributing! We welcome your contributions in whichever form they
may come.
This document provides guidelines and resources to help you successfully
contribute to the project. Rocket is a tool designed to push the envelope of
usability, security, _and_ performance in web frameworks, and accordingly, our
quality standards are high. To make the best use of everyone's time and avoid
wasted efforts, take a moment to understand our expectations and conventions
outlined here.
## Submitting Pull Requests
Before creating a new pull request:
* Read and understand [Code Style Conventions], [Commit Message Guidelines],
and [Testing].
* If you're resolving an open issue, follow [Resolving an Open Issue].
* If you're implementing new functionality, check whether the functionality
you're implementing has been proposed before, either as an [issue] or [pull
request]. Ensure your PR resolves any previously raised concerns. Then,
follow [Implementing an Unproposed Feature].
* For everything else, see [Other Common Contributions].
We aim to keep Rocket's code quality at the highest level. This means that any
code you contribute must be:
* **Commented:** Complex or subtle functionality must be properly commented.
* **Documented:** Public items must have doc comments with examples.
* **Styled:** Your code must folow the [Code Style Conventions].
* **Simple:** Your code should accomplish its task as simply and
idiomatically as possible.
* **Tested:** You must write (and pass) convincing [tests](#testing) for all
new or changed functionality.
* **Focused:** Your code should do what it's supposed to and nothing more.
### Resolving an Open Issue
[Resolving an Open Issue]: #resolving-an-open-issue
If you spot an open issue that you'd like to resolve:
1. **First identify if there's a proposed solution to the problem.**
If there is, proceed to step 2. If there isn't, your first course of
action, before writing any code, is to propose a solution. To do so, leave
a comment describing your solution in the relevant issue. It's especially
useful to see test cases and hypothetical examples. This step is critical:
it allows us to identify and resolve concerns with a proposed solution
before anyone spends time writing code. It may also allow us to point you
in more efficient implementation directions.
2. **Write a failing test case you expect to pass after resolving the issue.**
If you can write proper tests cases that fail, do so (see [Testing]). If
you cannot, for instance because you're introducing new APIs which can't be
used until they exist, write a test case that mocks usage of those APIs. In
either case, allow the tests and mock examples to guide your progress.
3. **Write basic functionality, pass tests, and submit a PR.**
Think about edge cases to the problem and ensure you have tests for those
edge cases. Once your implementation is functionally complete, submit a PR.
Don't spend time writing or changing a bunch of documentation just yet.
4. **Wait for a review, iterate, and polish.**
If a review doesn't come in a few days, feel free to ping a maintainer.
Once somene reviews your PR, integrate their feedback. If the PR solves the
issue (which it should because you have passing tests) and fits the project
(which it should since you sought feedback _before_ submitting), it will be
_conditionally_ approved pending final polish: documentation (rustdocs,
guide docs), style improvements, and testing. Your PR will then be merged.
### Implementing an Unproposed Feature
[Implementing an Unproposed Feature]: #implementing-an-unproposed-feature
First and foremost, **please do not submit a PR that implements a new feature
without first proposing a design and seeking feedback.** We take the addition of
new features _very_ seriously because they directly impact usability.
To propose a new feature, create a [new feature request issue] and follow the
template. Note that certain classes of features require particularly compelling
justification to be taken into consideration. These include features that:
* Can be implemented outside of Rocket.
* Introduce new dependencies, especially heavier ones.
* Only exist to add support for an external crate.
* Are too specific to one use-case.
* Are overtly complex _and_ have "simple" workarounds.
* Only partially solve a bigger deficiency.
Once your feature request is accepted, follow [Resolving an Open Issue].
[new feature request issue]: https://github.com/rwf2/Rocket/issues/new?assignees=&labels=request&projects=&template=feature-request.yml
### Other Common Contributions
[Other Common Contributions]: #other-common-contributions
* **Doc fixes, typos, wording improvements.**
We encourage any of these! Just a submit a PR with your changes. Please
preserve the surrounding markdown formatting as much as possible. This
typically means keeping lines under 80 characters, keeping table delimiters
aligned, and preserving indentation accordingly.
The guide's source files are at [docs/guide]. Note the following special
syntax available in guide markdown:
- **Cross-linking** pages is accomplished via relative links. Outside
of the index, this is: `../{page}#anchor`. For instance, to link to
**Quickstart > Running Examples**, use `../quickstart#running-examples`.
- **Aliases** are shorthand URLs that start with `@` (e.g, `@api`). They are
used throughout the guide to simplify creating versioned URLs. They are
replaced at build time with the appropriate versioned instance.
* **New examples or changes to existing ones.**
Please follow the [Implementing an Unproposed Feature] process.
* **Formatting or other purely cosmetic changes.**
We generally do not accept purely cosmetic changes to the codebase such as
style or formatting changes. All PRs must add something substantial to
Rocket's functionality, coherence, testing, performance, usability, bug
fixes, security, documentation, or overall maintainability.
* **Advertisements of any nature.**
We do not accept any contributions that resemble advertisements or
promotional content. If you are interested in supporting Rocket, we
encourage you to [sponsor the project].
## Testing
[Testing]: #testing
All testing happens through [test.sh]. Before submitting a PR, run the script
and fix any issues. The default mode (passing no arguments or `--default`) will
usually suffice, but you may also wish to execute additional tests. In
particular:
* If you make changes to `contrib`: `test.sh --contrib`
* If you make user-facing API changes or update deps: `test.sh --examples`
* If you add or modify feature flags: `test.sh --core`
* If you modify codegen: see [UI Tests].
Run `test.sh --help` to get an overview of how to execute the script:
```sh
USAGE:
./scripts/test.sh [+<TOOLCHAIN>] [--help|-h] [--<TEST>]
OPTIONS:
+<TOOLCHAIN> Forwarded to Cargo to select toolchain.
--help, -h Print this help message and exit.
--<TEST> Run the specified test suite.
(Run without --<TEST> to run default tests.)
AVAILABLE <TEST> OPTIONS:
default
all
core
contrib
examples
benchmarks
testbench
ui
EXAMPLES:
./scripts/test.sh # Run default tests on current toolchain.
./scripts/test.sh +stable --all # Run all tests on stable toolchain.
./scripts/test.sh --ui # Run UI tests on current toolchain.
```
### Writing Tests
Rocket is tested in a variety of ways. This includes via Rust's regular testing
facilities such as doctests, unit tests, and integration tests, as well Rocket's
examples, testbench, and [UI Tests]:
- **Examples**: The [`examples`](examples/) directory contains applications
that make use of many of Rocket's features. Each example is integration
tested using Rocket's built-in [local testing]. This both ensures that
typical Rocket code continues to work as expected and serves as a way to
detect and resolve user-facing breaking changes.
- **Testbench**: Rocket's [testbench](testbench/) tests end-to-end server or
protocol properties by starting up full Rocket servers to which it
dispatches real HTTP requests. Each server is independently written in
[testbench/src/servers/](testbench/src/servers/). You're unlikely to need to
write a testbench test unless you're modifying low-level details.
- **UI Tests**: UI tests ensure Rocket's codegen produces meaningful compiler
diagnostics. They compile Rocket applications and compare the compiler's
output to expected results. If you're changing codegen, you'll need to
update or create UI tests. See [UI Tests] for details.
For any change that affects functionality, we ask that you write a test that
verifies that functionality. Minimally, this means a unit test, doctest,
integration test, or some combination of these. For small changes, unit tests
will likely suffice. If the change affects the user in any way, then doctests
should be added or modified. And if the change requires using unrelated APIs to
test, then an integration test should be added.
Additionally, the following scenarios require special attention:
- **Improved Features**
Modifying an existing example is a great place to write tests for improved
features. If you do modify an example, make sure you modify the README in
the example directory, too.
- **New Features**
For major features, introducing a new example that showcases idiomatic use
of the feature can be useful. Make sure you modify the README in the
`examples` directory if you do. In addition, all newly introduced public
APIs should be fully documented and include doctests as well as unit and
integration tests.
- **Fixing a Bug**
To avoid regressions, _always_ introduce or modify an integration or
testbench test for a bugfix. Integration tests should live in the usual
`tests/` directory and be named `short-issue-description-NNNN.rs`, where
`NNNN` is the GitHub issue number for the bug. For example,
`forward-includes-status-1560.rs`.
[local testing]: https://api.rocket.rs/master/rocket/local/
### UI Tests
[UI Tests]: #ui-tests
Changes to codegen (i.e, `rocket_codegen` and other `_codegen` crates)
necessitate adding and running UI tests, which capture compiler output and
compare it against some expected output. UI tests use [`trybuild`].
Tests can be found in the `codegen/tests/ui-fail` directories of respective
`codegen` crates. Each test is symlinked into sibling `ui-fail-stable` and
`ui-fail-nightly` directories, which also contain the expected error output for
stable and nightly compilers, respectively. For example:
```
./core/codegen/tests
├── ui-fail
│   ├── async-entry.rs
│   ├── ...
│   └── uri_display_type_errors.rs
├── ui-fail-nightly
│   ├── async-entry.rs -> ../ui-fail/async-entry.rs
│   ├── async-entry.stderr
│   ├── ...
│   ├── uri_display_type_errors.rs -> ../ui-fail/uri_display_type_errors.rs
│   └── uri_display_type_errors.stderr
└── ui-fail-stable
   ├── async-entry.rs -> ../ui-fail/async-entry.rs
   ├── async-entry.stderr
   ├── ...
   ├── uri_display_type_errors.rs -> ../ui-fail/uri_display_type_errors.rs
   └── uri_display_type_errors.stderr
```
If you make changes to codegen, run the UI tests for stable and nightly with
`test.sh +stable --ui` and `test.sh +nightly --ui`. If there are failures,
update the outputs with `TRYBUILD=overwrite test.sh +nightly --ui` and
`TRYBUILD=overwrite test.sh +stable --ui`. Look at the diff to see what's
changed. Ensure that error messages properly attribute (i.e., visually underline
or point to) the source of the error. For example, if a type need to implement a
trait, then that type should be underlined. We strive to emit the most helpful
and descriptive error messages possible.
### API Docs
If you make changes to documentation, you should build the API docs and verify
that your changes look as you expect. API documentation is built with
[mk-docs.sh] and output to the usual `target/docs` directory. By default, the
script will `clean` any existing docs to avoid potential caching issues. To
override this behavior, use `mk-docs.sh -d`.
## Code Style Conventions
[Code Style Conventions]: #code-style-conventions
We _do not_ use `rustfmt` or `cargo fmt` due to bugs and missing functionality.
Instead, we ask that you follow the [Rust Style Guide] with the following
changes:
**Always separate items with one blank line.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
fn foo() {
// ..
}
fn bar() {
// ..
}
```
</td>
<td>
```rust
fn foo() {
// ..
}
fn bar() {
// ..
}
```
</td>
</tr>
</tbody>
</table>
**Prefer a where-clause over block-indented generics.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
fn foo<T, U>(x: Vec<T>, y: Vec<U>)
where T: Display, U: Debug
{
// ..
}
```
</td>
<td>
```rust
fn foo<
T: Display,
U: Debug,
>(x: Vec<T>, y: Vec<U>) {
// ..
}
```
</td>
</tr>
</tbody>
</table>
**For "short" where-clauses, follow Rust guidelines. For "long" where-clauses,
block-indent `where`, place the first bound on the same line as `where`, and
block-align the remaining bounds.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
fn foo<T, F, Item, G>(v: Foo<T, F, Item>) -> G
where T: for<'x> SomeTrait<'x>
F: Fn(Item) -> G,
Item: Display + Debug,
G: Error,
{
// ..
}
```
</td>
<td>
```rust
fn foo<T, F, Item, G>(v: Foo<T, F, Item>) -> G
where
T: for<'x> SomeTrait<'x>
F: Fn(Item) -> G,
Item: Display + Debug,
G: Error,
{
// ..
}
```
</td>
</tr>
</tbody>
</table>
**Do not use multi-line imports. Use multiple lines grouped by import kind if
possible.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
use foo::{Long, List, Of, Type, Imports};
use foo::{some_macro, imports};
```
</td>
<td>
```rust
use foo::{
Long, List, Of, Type, Imports,
some_macro, imports,
};
```
</td>
</tr>
</tbody>
</table>
**Order imports in order of decreasing "distance" to the current module: `std`,
`core`, and `alloc`, external crates, then current crate. Prefer using `crate`
relative imports to `super`. Separate each category with one blank line.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
use std::{foo, bar};
use alloc::{bar, baz};
use either::Either;
use futures::{SomeItem, OtherItem};
use crate::{item1, item2};
use crate::module::item3;
use crate::module2::item4;
```
</td>
<td>
```rust
use crate::{item1, item2};
use std::{foo, bar};
use either::Either;
use alloc::{bar, baz};
use futures::{SomeItem, OtherItem};
use super::{item3, item4};
use super::item4;
```
</td>
</tr>
</tbody>
</table>
## Commit Message Guidelines
[Commit Message Guidelines]: #commit-message-guidelines
Git commit messages should start with a single-line _header_ of at most 50
characters followed by a body with any number of descriptive paragraphs, with
lines not to exceed 72 characters, and a footer.
The **header** must be an imperative statement that precisely describes the
primary change made by the commit. The goal is to give the reader a good
understanding of what the commit does via only the header. It should not require
context to understand. It should not include references to git commits or
issues. Avoid using Markdown in the header if possible.
Typically, the first word in the header will be one of the following:
* **Fix** - to fix a functional or doc bug
- Example: `Fix 'TcpListener': allow 'udp://' prefix.`
* **Improve** - for minor feature or doc improvements
- Example: `Improve 'FromParam' derive error messages.`
* **Introduce** - for major feature introductions
- Example: `Introduce WebSocket support.`
* **Add**, **Remove** - for changes
- Example: `Add 'Foo::new()' constructor.`
- Example: `Remove 'Foo::new()'; add 'Foo::build()'.`
* **Update** - for crate updates
- Example: `Update 'base64' to 0.12.`
* **Impl** or **Implement** - for trait implementations
- Example: `Implement 'FromForm' for 'ThisNewType'.`
Note how generic words like "change" are avoided, and how the headers are
specific about the changes they made. You need not limit yourself to this
vocabulary. When in doubt, consult the `git log` for examples.
| **✅ Yes** | **No 🚫** |
|--------------------------------------------------|--------------------------------------------|
| Fix 'FromForm' derive docs typo: 'yis' -> 'yes'. | ~~Change word in docs~~ |
| Default 'MsgPack<T>' to named variant. | ~~Change default to more likely variant.~~ |
| Fix 'Compact' advice in 'MsgPack' docs. | ~~Update docs to make sense~~ |
| Improve 'Sentinel' docs: explain 'Sentry'. | ~~Add missing doc details.~~ |
| Fix CI: pin macOS CI 'mysql-client' to '8.4'. | ~~Fix CI~~ |
| Fix link to 'rocket::build()' in config guide. | ~~Fix wrong URL in guide (configuration~~) |
The **body** should describe what the commit does. For example, if the commit
introduces a new feature it should describe what the feature enables and how it
enables it. A body may be unnecessary if the header sufficiently describes the
commit. Avoid referencing issues in the body as well: we'll do that in the
footer. If you reference a commit, reference it by shorthash only. Feel free to
use markdown including lists and code.
Finally, the **footer** is where references to issues should be made. See the
GitHub's [linked issues] documentation.
[linked issues]: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
[Rust Style Guide]: https://doc.rust-lang.org/nightly/style-guide/
[issue]: https://github.com/rwf2/Rocket/issues
[pull request]: https://github.com/rwf2/Rocket/pulls
[test.sh]: scripts/test.sh
[mk-docs.sh]: scripts/mk-docs.sh
[`trybuild`]: https://docs.rs/trybuild
[sponsor the project]: https://github.com/sponsors/rwf2
[docs/guide]: docs/guide
## Licensing
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Rocket by you shall be dual licensed under the MIT License and
Apache License, Version 2.0, without any additional terms or conditions.
The Rocket website docs are licensed under [separate terms](docs/LICENSE). Any
contribution intentionally submitted for inclusion in the Rocket website docs by
you shall be licensed under those terms.

120
README.md
View File

@ -4,7 +4,6 @@
[![Rocket Homepage](https://img.shields.io/badge/web-rocket.rs-red.svg?style=flat&label=https&colorB=d33847)](https://rocket.rs)
[![Current Crates.io Version](https://img.shields.io/crates/v/rocket.svg)](https://crates.io/crates/rocket)
[![Matrix: #rocket:mozilla.org](https://img.shields.io/badge/style-%23rocket:mozilla.org-blue.svg?style=flat&label=[m])](https://chat.mozilla.org/#/room/#rocket:mozilla.org)
[![IRC: #rocket on irc.libera.chat](https://img.shields.io/badge/style-%23rocket-blue.svg?style=flat&label=Libera.Chat)](https://kiwiirc.com/client/irc.libera.chat/#rocket)
Rocket is an async web framework for Rust with a focus on usability, security,
extensibility, and speed.
@ -44,113 +43,58 @@ Rocket is extensively documented:
[Guide]: https://rocket.rs/guide/
[API Documentation]: https://api.rocket.rs
The official community support channels are [`#rocket:mozilla.org`] on Matrix
and the bridged [`#rocket`] IRC channel on Libera.Chat at `irc.libera.chat`. We
recommend joining us on [Matrix via Element]. If your prefer IRC, you can join
via the [Kiwi IRC client] or a client of your own.
Documentation for the `master` branch is available at https://rocket.rs/master
and https://api.rocket.rs/master.
[`#rocket:mozilla.org`]: https://chat.mozilla.org/#/room/#rocket:mozilla.org
[`#rocket`]: https://kiwiirc.com/client/irc.libera.chat/#rocket
[Matrix via Element]: https://chat.mozilla.org/#/room/#rocket:mozilla.org
[Kiwi IRC Client]: https://kiwiirc.com/client/irc.libera.chat/#rocket
Documentation for major release version `${x}` is available at
`https://[api.]rocket.rs/v${x}`. For example, the v0.4 docs are available at
https://rocket.rs/v0.4 and https://api.rocket.rs/v0.4.
Finally, API docs for active git branches are available at
`https://api.rocket.rs/${branch}`. For example, API docs for the `master` branch
are available at https://api.rocket.rs/master. Branch rustdocs are built and
deployed on every commit.
## Examples
An extensive number of examples are provided in the `examples/` directory. Each
example can be compiled and run with Cargo. For instance, the following sequence
of commands builds and runs the `Hello, world!` example:
The [examples](examples#readme) directory contains complete crates that showcase
Rocket's features and usage. Each example can be compiled and run with Cargo.
For instance, the following sequence of commands builds and runs the `hello`
example:
```sh
cd examples/hello
cargo run
```
You should see `Hello, world!` by visiting `http://localhost:8000`.
## Getting Help
## Building and Testing
If you find yourself needing help outside of the documentation, you may:
The `core` directory contains the three core libraries: `lib`, `codegen`, and
`http` published as `rocket`, `rocket_codegen` and `rocket_http`, respectively.
The latter two are implementations details and are reexported from `rocket`.
* Ask questions via [GitHub discussions questions].
* Chat with us at [`#rocket:mozilla.org`] on Matrix (join [via Element]).
### Testing
Rocket's complete test suite can be run with `./scripts/test.sh` from the root
of the source tree. The script builds and tests all libraries and examples in
all configurations. It accepts the following flags:
* `--examples`: tests all examples in `examples/`
* `--contrib`: tests each `contrib` library and feature individually
* `--core`: tests each `core/lib` feature individually
* `--benchmarks`: runs all benchmarks
* `--all`: runs all tests in all configurations
Additionally, a `+${toolchain}` flag, where `${toolchain}` is a valid `rustup`
toolchain string, can be passed as the first parameter. The flag is forwarded to
`cargo` commands. Any other extra parameters are passed directly to `cargo`.
To test crates individually, simply run `cargo test --all-features` in the
crate's directory.
### Codegen Testing
Code generation diagnostics are tested using [`trybuild`]; tests can be found in
the `codegen/tests/ui-fail` directories of respective `codegen` crates. Each
test is symlinked into sibling `ui-fail-stable` and `ui-fail-nightly`
directories which contain the expected error output for stable and nightly
compilers, respectively. To update codegen test UI output, run a codegen test
suite with `TRYBUILD=overwrite` and inspect the `diff` of `.std*` files.
[`trybuild`]: https://docs.rs/trybuild/1
### API Docs
API documentation is built with `./scripts/mk-docs.sh`. The resulting assets are
uploaded to [api.rocket.rs](https://api.rocket.rs/).
Documentation for a released version `${x}` can be found at
`https://api.rocket.rs/v${x}` and `https://rocket.rs/v${x}`. For instance, the
documentation for `0.4` can be found at https://api.rocket.rs/v0.4 and
https://rocket.rs/v0.4. Documentation for unreleased versions in branch
`${branch}` be found at `https://api.rocket.rs/${branch}` and
`https://rocket.rs/${branch}`. For instance, the documentation for the `master`
branch can be found at https://api.rocket.rs/master and
https://rocket.rs/master. Documentation for unreleased branches is updated
periodically.
[`#rocket:mozilla.org`]: https://chat.mozilla.org/#/room/#rocket:mozilla.org
[via Element]: https://chat.mozilla.org/#/room/#rocket:mozilla.org
[GitHub discussions questions]: https://github.com/rwf2/Rocket/discussions/categories/questions
## Contributing
Contributions are absolutely, positively welcome and encouraged! Contributions
come in many forms. You could:
Contributions are absolutely, positively welcomed and encouraged! If you're
interested in contributing code, please first read [CONTRIBUTING] for complete
guidelines. Additionally, you could:
1. Submit a feature request or bug report as an [issue].
2. Ask for improved documentation as an [issue].
3. Comment on [issues that require feedback].
4. Contribute code via [pull requests].
4. Answers questions in [GitHub discussions questions].
5. Share a project in [GitHub discussions show & tell].
[issue]: https://github.com/rwf2/Rocket/issues
[issues that require feedback]: https://github.com/rwf2/Rocket/issues?q=is%3Aissue+is%3Aopen+label%3A%22feedback+wanted%22
[pull requests]: https://github.com/rwf2/Rocket/pulls
We aim to keep Rocket's code quality at the highest level. This means that any
code you contribute must be:
* **Commented:** Complex and non-obvious functionality must be properly
commented.
* **Documented:** Public items _must_ have doc comments with examples, if
applicable.
* **Styled:** Your code's style should match the existing and surrounding code
style.
* **Simple:** Your code should accomplish its task as simply and
idiomatically as possible.
* **Tested:** You must write (and pass) convincing tests for any new
functionality.
* **Focused:** Your code should do what it's supposed to and nothing more.
All pull requests are code reviewed and tested by the CI. Note that unless you
explicitly state otherwise, any contribution intentionally submitted for
inclusion in Rocket by you shall be dual licensed under the MIT License and
Apache License, Version 2.0, without any additional terms or conditions.
[CONTRIBUTING]: CONTRIBUTING.md
[GitHub discussions show & tell]: https://github.com/rwf2/Rocket/discussions/categories/show-tell
## License
@ -159,4 +103,10 @@ Rocket is licensed under either of the following, at your option:
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
* MIT License ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
The Rocket website docs are licensed under [separate terms](docs/LICENSE).
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Rocket by you shall be dual licensed under the MIT License and
Apache License, Version 2.0, without any additional terms or conditions.
The Rocket website docs are licensed under [separate terms](docs/LICENSE). Any
contribution intentionally submitted for inclusion in the Rocket website docs by
you shall be licensed under those terms.

View File

@ -26,8 +26,8 @@ sqlx_postgres = ["sqlx", "sqlx/postgres", "log"]
sqlx_sqlite = ["sqlx", "sqlx/sqlite", "log"]
sqlx_macros = ["sqlx/macros"]
# diesel features
diesel_postgres = ["diesel-async/postgres", "diesel-async/deadpool", "diesel", "deadpool_09"]
diesel_mysql = ["diesel-async/mysql", "diesel-async/deadpool", "diesel", "deadpool_09"]
diesel_postgres = ["diesel-async/postgres", "diesel-async/deadpool", "deadpool", "diesel"]
diesel_mysql = ["diesel-async/mysql", "diesel-async/deadpool", "deadpool", "diesel"]
# implicit features: mongodb
[dependencies.rocket]
@ -39,27 +39,20 @@ default-features = false
path = "../codegen"
version = "0.1.0"
[dependencies.deadpool_09]
package = "deadpool"
version = "0.9.5"
default-features = false
features = ["rt_tokio_1", "managed"]
optional = true
[dependencies.deadpool-postgres]
version = "0.13.2"
default-features = false
features = ["rt_tokio_1"]
optional = true
[dependencies.deadpool]
version = "0.12.1"
default-features = false
features = ["rt_tokio_1", "managed"]
optional = true
[dependencies.deadpool-postgres]
version = "0.14"
default-features = false
features = ["rt_tokio_1"]
optional = true
[dependencies.deadpool-redis]
version = "0.15"
version = "0.16"
default-features = false
features = ["rt_tokio_1"]
optional = true
@ -71,8 +64,9 @@ features = ["compat-3-0-0", "rustls-tls"]
optional = true
[dependencies.diesel-async]
version = "0.4.1"
version = "0.5.0"
default-features = false
features = ["async-connection-wrapper"]
optional = true
[dependencies.diesel]
@ -81,7 +75,7 @@ default-features = false
optional = true
[dependencies.sqlx]
version = "0.7"
version = "0.8"
default-features = false
features = ["runtime-tokio-rustls"]
optional = true

View File

@ -84,6 +84,9 @@ pub use diesel_async::pg;
#[doc(inline)]
pub use diesel_async::pooled_connection::deadpool::Pool;
#[doc(inline)]
pub use diesel_async::async_connection_wrapper::AsyncConnectionWrapper;
#[doc(inline)]
#[cfg(feature = "diesel_mysql")]
pub use diesel_async::AsyncMysqlConnection;

View File

@ -103,12 +103,12 @@
//! Drivers have a varying degree of support for graceful shutdown, affected by
//! the `Type::init()` fairing on Rocket shutdown.
//!
//! ## `deadpool` (v0.13)
//! ## `deadpool` (v0.12)
//!
//! | Database | Feature | [`Pool`] Type | [`Connection`] Deref |
//! |----------|-----------------------------|-----------------------------|--------------------------------------|
//! | Postgres | `deadpool_postgres` (v0.13) | [`deadpool_postgres::Pool`] | [`deadpool_postgres::ClientWrapper`] |
//! | Redis | `deadpool_redis` (v0.15) | [`deadpool_redis::Pool`] | [`deadpool_redis::Connection`] |
//! | Postgres | `deadpool_postgres` (v0.14) | [`deadpool_postgres::Pool`] | [`deadpool_postgres::ClientWrapper`] |
//! | Redis | `deadpool_redis` (v0.16) | [`deadpool_redis::Pool`] | [`deadpool_redis::Connection`] |
//!
//! On shutdown, new connections are denied. Shutdown _does not_ wait for
//! connections to be returned.

View File

@ -157,6 +157,9 @@ mod deadpool_postgres {
use deadpool::{Runtime, managed::{Manager, Pool, PoolError, Object}};
use super::{Duration, Error, Config, Figment};
#[cfg(feature = "diesel")]
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
pub trait DeadManager: Manager + Sized + Send + Sync + 'static {
fn new(config: &Config) -> Result<Self, Self::Error>;
}
@ -175,6 +178,20 @@ mod deadpool_postgres {
}
}
#[cfg(feature = "diesel_postgres")]
impl DeadManager for AsyncDieselConnectionManager<diesel_async::AsyncPgConnection> {
fn new(config: &Config) -> Result<Self, Self::Error> {
Ok(Self::new(config.url.as_str()))
}
}
#[cfg(feature = "diesel_mysql")]
impl DeadManager for AsyncDieselConnectionManager<diesel_async::AsyncMysqlConnection> {
fn new(config: &Config) -> Result<Self, Self::Error> {
Ok(Self::new(config.url.as_str()))
}
}
#[rocket::async_trait]
impl<M: DeadManager, C: From<Object<M>>> crate::Pool for Pool<M, C>
where M::Type: Send, C: Send + Sync + 'static, M::Error: std::error::Error
@ -207,64 +224,6 @@ mod deadpool_postgres {
}
}
// TODO: Remove when new release of diesel-async with deadpool 0.10 is out.
#[cfg(all(feature = "deadpool_09", any(feature = "diesel_postgres", feature = "diesel_mysql")))]
mod deadpool_old {
use deadpool_09::{managed::{Manager, Pool, PoolError, Object, BuildError}, Runtime};
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
use super::{Duration, Error, Config, Figment};
pub trait DeadManager: Manager + Sized + Send + Sync + 'static {
fn new(config: &Config) -> Result<Self, Self::Error>;
}
#[cfg(feature = "diesel_postgres")]
impl DeadManager for AsyncDieselConnectionManager<diesel_async::AsyncPgConnection> {
fn new(config: &Config) -> Result<Self, Self::Error> {
Ok(Self::new(config.url.as_str()))
}
}
#[cfg(feature = "diesel_mysql")]
impl DeadManager for AsyncDieselConnectionManager<diesel_async::AsyncMysqlConnection> {
fn new(config: &Config) -> Result<Self, Self::Error> {
Ok(Self::new(config.url.as_str()))
}
}
#[rocket::async_trait]
impl<M: DeadManager, C: From<Object<M>>> crate::Pool for Pool<M, C>
where M::Type: Send, C: Send + Sync + 'static, M::Error: std::error::Error
{
type Error = Error<BuildError<M::Error>, PoolError<M::Error>>;
type Connection = C;
async fn init(figment: &Figment) -> Result<Self, Self::Error> {
let config: Config = figment.extract()?;
let manager = M::new(&config).map_err(|e| Error::Init(BuildError::Backend(e)))?;
Pool::builder(manager)
.max_size(config.max_connections)
.wait_timeout(Some(Duration::from_secs(config.connect_timeout)))
.create_timeout(Some(Duration::from_secs(config.connect_timeout)))
.recycle_timeout(config.idle_timeout.map(Duration::from_secs))
.runtime(Runtime::Tokio1)
.build()
.map_err(Error::Init)
}
async fn get(&self) -> Result<Self::Connection, Self::Error> {
self.get().await.map_err(Error::Get)
}
async fn close(&self) {
<Pool<M, C>>::close(self)
}
}
}
#[cfg(feature = "sqlx")]
mod sqlx {
use sqlx::ConnectOptions;

View File

@ -19,7 +19,7 @@ diesel_postgres_pool = ["diesel/postgres", "diesel/r2d2"]
diesel_mysql_pool = ["diesel/mysql", "diesel/r2d2"]
sqlite_pool = ["rusqlite", "r2d2_sqlite"]
postgres_pool = ["postgres", "r2d2_postgres"]
memcache_pool = ["memcache", "r2d2-memcache"]
memcache_pool = ["memcache"]
[dependencies]
r2d2 = "0.8"
@ -31,11 +31,10 @@ diesel = { version = "2.0.0", default-features = false, optional = true }
postgres = { version = "0.19", optional = true }
r2d2_postgres = { version = "0.18", optional = true }
rusqlite = { version = "0.29.0", optional = true }
r2d2_sqlite = { version = "0.22.0", optional = true }
rusqlite = { version = "0.31.0", optional = true }
r2d2_sqlite = { version = "0.24.0", optional = true }
memcache = { version = "0.15.2", optional = true }
r2d2-memcache = { version = "0.6", optional = true }
memcache = { version = "0.17.2", optional = true }
[dependencies.rocket_sync_db_pools_codegen]
version = "0.1.0"
@ -49,5 +48,11 @@ default-features = false
[build-dependencies]
version_check = "0.9.1"
[dev-dependencies.rocket]
version = "0.6.0-dev"
path = "../../../core/lib"
default-features = false
features = ["trace"]
[package.metadata.docs.rs]
all-features = true

View File

@ -182,31 +182,42 @@ impl<K, C: Poolable> Drop for Connection<K, C> {
let connection = self.connection.clone();
let permit = self.permit.take();
// See same motivation above for this arrangement of spawn_blocking/block_on
tokio::task::spawn_blocking(move || {
let mut connection = tokio::runtime::Handle::current().block_on(async {
connection.lock_owned().await
});
// Only use spawn_blocking if the Tokio runtime is still available
if let Ok(handle) = tokio::runtime::Handle::try_current() {
// See above for motivation of this arrangement of spawn_blocking/block_on
handle.spawn_blocking(move || {
let mut connection = tokio::runtime::Handle::current()
.block_on(async { connection.lock_owned().await });
if let Some(conn) = connection.take() {
if let Some(conn) = connection.take() {
drop(conn);
}
});
} else {
warn!(type_name = std::any::type_name::<K>(),
"database connection is being dropped outside of an async context\n\
this means you have stored a connection beyond a request's lifetime\n\
this is not recommended: connections are not valid indefinitely\n\
instead, store a connection pool and get connections as needed");
if let Some(conn) = connection.blocking_lock().take() {
drop(conn);
}
}
// Explicitly dropping the permit here so that it's only
// released after the connection is.
drop(permit);
});
// Explicitly drop permit here to release only after dropping connection.
drop(permit);
}
}
impl<K, C: Poolable> Drop for ConnectionPool<K, C> {
fn drop(&mut self) {
// Use spawn_blocking if the Tokio runtime is still available. Otherwise
// the pool will be dropped on the current thread.
let pool = self.pool.take();
// Only use spawn_blocking if the Tokio runtime is still available
if let Ok(handle) = tokio::runtime::Handle::try_current() {
handle.spawn_blocking(move || drop(pool));
}
// Otherwise the pool will be dropped on the current thread
}
}

View File

@ -317,8 +317,8 @@
//! | Postgres | [Diesel] | `2` | [`diesel::PgConnection`] | `diesel_postgres_pool` |
//! | MySQL | [Diesel] | `2` | [`diesel::MysqlConnection`] | `diesel_mysql_pool` |
//! | Postgres | [Rust-Postgres] | `0.19` | [`postgres::Client`] | `postgres_pool` |
//! | Sqlite | [`Rusqlite`] | `0.27` | [`rusqlite::Connection`] | `sqlite_pool` |
//! | Memcache | [`memcache`] | `0.15` | [`memcache::Client`] | `memcache_pool` |
//! | Sqlite | [`Rusqlite`] | `0.31` | [`rusqlite::Connection`] | `sqlite_pool` |
//! | Memcache | [`memcache`] | `0.17` | [`memcache::Client`] | `memcache_pool` |
//!
//! [Diesel]: https://diesel.rs
//! [`diesel::SqliteConnection`]: https://docs.rs/diesel/2/diesel/sqlite/struct.SqliteConnection.html
@ -327,10 +327,10 @@
//! [Rust-Postgres]: https://github.com/sfackler/rust-postgres
//! [`postgres::Client`]: https://docs.rs/postgres/0.19/postgres/struct.Client.html
//! [`Rusqlite`]: https://github.com/jgallagher/rusqlite
//! [`rusqlite::Connection`]: https://docs.rs/rusqlite/0.27/rusqlite/struct.Connection.html
//! [`rusqlite::Connection`]: https://docs.rs/rusqlite/0.31/rusqlite/struct.Connection.html
//! [`diesel::PgConnection`]: http://docs.diesel.rs/diesel/pg/struct.PgConnection.html
//! [`memcache`]: https://github.com/aisk/rust-memcache
//! [`memcache::Client`]: https://docs.rs/memcache/0.15/memcache/struct.Client.html
//! [`memcache::Client`]: https://docs.rs/memcache/0.17/memcache/struct.Client.html
//!
//! The above table lists all the supported database adapters in this library.
//! In order to use particular `Poolable` type that's included in this library,
@ -372,7 +372,6 @@ pub use diesel;
#[cfg(feature = "sqlite_pool")] pub use r2d2_sqlite;
#[cfg(feature = "memcache_pool")] pub use memcache;
#[cfg(feature = "memcache_pool")] pub use r2d2_memcache;
pub use r2d2;

View File

@ -13,11 +13,12 @@ use crate::{Config, Error};
///
/// Implementations of `Poolable` are provided for the following types:
///
/// * `diesel::MysqlConnection`
/// * `diesel::PgConnection`
/// * `diesel::SqliteConnection`
/// * `postgres::Connection`
/// * `rusqlite::Connection`
/// * [`diesel::MysqlConnection`](diesel::MysqlConnection)
/// * [`diesel::PgConnection`](diesel::PgConnection)
/// * [`diesel::SqliteConnection`](diesel::SqliteConnection)
/// * [`postgres::Client`](postgres::Client)
/// * [`rusqlite::Connection`](rusqlite::Connection)
/// * [`memcache::Client`](memcache::Client)
///
/// # Implementation Guide
///
@ -130,7 +131,7 @@ impl Poolable for diesel::SqliteConnection {
fn on_acquire(&self, conn: &mut SqliteConnection) -> Result<(), Error> {
conn.batch_execute("\
PRAGMA journal_mode = WAL;\
PRAGMA busy_timeout = 1000;\
PRAGMA busy_timeout = 5000;\
PRAGMA foreign_keys = ON;\
").map_err(Error::QueryError)?;
@ -263,19 +264,52 @@ impl Poolable for rusqlite::Connection {
}
#[cfg(feature = "memcache_pool")]
impl Poolable for memcache::Client {
type Manager = r2d2_memcache::MemcacheConnectionManager;
// Unused, but we might want it in the future without a breaking change.
type Error = memcache::MemcacheError;
mod memcache_pool {
use memcache::{Client, Connectable, MemcacheError};
fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
let config = Config::from(db_name, rocket)?;
let manager = r2d2_memcache::MemcacheConnectionManager::new(&*config.url);
let pool = r2d2::Pool::builder()
.max_size(config.pool_size)
.connection_timeout(Duration::from_secs(config.timeout as u64))
.build(manager)?;
use super::*;
Ok(pool)
#[derive(Debug)]
pub struct ConnectionManager {
urls: Vec<String>,
}
impl ConnectionManager {
pub fn new<C: Connectable>(target: C) -> Self {
Self { urls: target.get_urls(), }
}
}
impl r2d2::ManageConnection for ConnectionManager {
type Connection = Client;
type Error = MemcacheError;
fn connect(&self) -> Result<Client, MemcacheError> {
Client::connect(self.urls.clone())
}
fn is_valid(&self, connection: &mut Client) -> Result<(), MemcacheError> {
connection.version().map(|_| ())
}
fn has_broken(&self, _connection: &mut Client) -> bool {
false
}
}
impl super::Poolable for memcache::Client {
type Manager = ConnectionManager;
type Error = MemcacheError;
fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
let config = Config::from(db_name, rocket)?;
let manager = ConnectionManager::new(&*config.url);
let pool = r2d2::Pool::builder()
.max_size(config.pool_size)
.connection_timeout(Duration::from_secs(config.timeout as u64))
.build(manager)?;
Ok(pool)
}
}
}

View File

@ -11,6 +11,16 @@ mod databases_tests {
struct PrimaryDb(diesel::PgConnection);
}
#[cfg(feature = "memcache_pool")]
mod memcache_pool_tests {
#![allow(dead_code)]
use rocket_sync_db_pools::database;
#[database("test_db")]
struct MemcacheDb(memcache::Client);
}
#[cfg(test)]
#[cfg(all(feature = "sqlite_pool"))]
mod rusqlite_integration_test {

View File

@ -0,0 +1,25 @@
#![cfg(feature = "diesel_sqlite_pool")]
use rocket::figment::Figment;
use rocket_sync_db_pools::database;
#[database("example")]
struct ExampleDb(diesel::SqliteConnection);
#[test]
fn can_drop_connection_in_sync_context() {
let conn = rocket::execute(async {
let figment = Figment::from(rocket::Config::debug_default())
.merge(("databases.example.url", ":memory:"));
let rocket = rocket::custom(figment)
.attach(ExampleDb::fairing())
.ignite().await
.expect("rocket");
ExampleDb::get_one(&rocket).await
.expect("attach => connection")
});
drop(conn);
}

View File

@ -20,7 +20,7 @@ default = ["tungstenite"]
tungstenite = ["tokio-tungstenite"]
[dependencies]
tokio-tungstenite = { version = "0.21", optional = true }
tokio-tungstenite = { version = "0.23", optional = true }
[dependencies.rocket]
version = "0.6.0-dev"

View File

@ -0,0 +1,43 @@
use devise::*;
use devise::ext::SpanDiagnosticExt;
use quote::quote;
use proc_macro2::TokenStream;
use syn::ext::IdentExt;
use crate::exports::*;
pub fn derive_from_param(input: proc_macro::TokenStream) -> TokenStream {
DeriveGenerator::build_for(input, quote!(impl<'a> #_request::FromParam<'a>))
.support(Support::Enum)
.validator(ValidatorBuild::new().fields_validate(|_, fields| {
if !fields.is_empty() {
return Err(fields.span().error("variants with data fields are not supported"));
}
Ok(())
}))
.inner_mapper(MapperBuild::new().enum_map(|_, data| {
let matches = data.variants().map(|field| {
let field_name = field.ident.unraw();
quote!(stringify!(#field_name) => Ok(Self::#field))
});
let names = data.variants().map(|field| {
let field_name = field.ident.unraw();
quote!(stringify!(#field_name))
});
quote! {
type Error = #_error::InvalidOption<'a>;
fn from_param(param: &'a str) -> Result<Self, Self::Error> {
match param {
#(#matches,)*
_ => Err(#_error::InvalidOption::new(param, &[#(#names),*])),
}
}
}
}))
.to_tokens()
}

View File

@ -3,3 +3,4 @@ pub mod from_form;
pub mod from_form_field;
pub mod responder;
pub mod uri_display;
pub mod from_param;

View File

@ -774,6 +774,48 @@ pub fn derive_from_form(input: TokenStream) -> TokenStream {
emit!(derive::from_form::derive_from_form(input))
}
/// Derive for the [`FromParam`] trait.
///
/// This [`FromParam`] derive can be applied to C-like enums whose variants have
/// no fields. The generated implementation case-sensitively matches each
/// variant to its stringified field name. If there is no match, an error
/// of type [`InvalidOption`] is returned.
///
/// [`FromParam`]: ../rocket/request/trait.FromParam.html
/// [`InvalidOption`]: ../rocket/error/struct.InvalidOption.html
///
/// # Example
///
/// ```rust
/// # #[macro_use] extern crate rocket;
/// use rocket::request::FromParam;
///
/// #[derive(FromParam, Debug, PartialEq)]
/// enum MyParam {
/// A,
/// Bob,
/// }
///
/// assert_eq!(MyParam::from_param("A").unwrap(), MyParam::A);
/// assert_eq!(MyParam::from_param("Bob").unwrap(), MyParam::Bob);
/// assert!(MyParam::from_param("a").is_err());
/// assert!(MyParam::from_param("bob").is_err());
/// assert!(MyParam::from_param("c").is_err());
/// assert!(MyParam::from_param("C").is_err());
///
/// // Now `MyParam` can be used in an route to accept either `A` or `B`.
/// #[get("/<param>")]
/// fn index(param: MyParam) -> &'static str {
/// match param {
/// MyParam::A => "A",
/// MyParam::Bob => "Bob",
/// }
/// }
#[proc_macro_derive(FromParam)]
pub fn derive_from_param(input: TokenStream) -> TokenStream {
emit!(derive::from_param::derive_from_param(input))
}
/// Derive for the [`Responder`] trait.
///
/// The [`Responder`] derive can be applied to enums and structs with named

View File

@ -80,7 +80,7 @@ impl IdentExt for syn::Ident {
self.prepend(crate::ROCKET_IDENT_PREFIX)
}
/// Create a unqiue version of the ident `self` based on the hash of `self`,
/// Create a unique version of the ident `self` based on the hash of `self`,
/// its span, the current call site, and any additional information provided
/// by the closure `f`.
///

View File

@ -0,0 +1,25 @@
use rocket::request::FromParam;
#[allow(non_camel_case_types)]
#[derive(Debug, FromParam, PartialEq)]
enum Test {
Test1,
Test2,
r#for,
}
#[test]
fn derive_from_param() {
assert_eq!(Test::from_param("Test1").unwrap(), Test::Test1);
assert_eq!(Test::from_param("Test2").unwrap(), Test::Test2);
assert_eq!(Test::from_param("for").unwrap(), Test::r#for);
let err = Test::from_param("For").unwrap_err();
assert_eq!(err.value, "For");
assert_eq!(err.options, &["Test1", "Test2", "for"]);
let err = Test::from_param("not_test").unwrap_err();
assert_eq!(err.value, "not_test");
assert_eq!(err.options, &["Test1", "Test2", "for"]);
}

View File

@ -66,9 +66,9 @@ error[E0308]: arguments to this function are incorrect
--> tests/ui-fail-nightly/catch.rs:30:4
|
30 | fn f3(_request: &Request, _other: bool) { }
| ^^ -------- ---- an argument of type `bool` is missing
| ^^ -------- ---- argument #2 of type `bool` is missing
| |
| unexpected argument of type `Status`
| unexpected argument #1 of type `Status`
|
note: function defined here
--> tests/ui-fail-nightly/catch.rs:30:4

View File

@ -7,14 +7,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
`&'o [u8]` implements `Responder<'r, 'o>`
`&'o str` implements `Responder<'r, 'o>`
`()` implements `Responder<'r, 'static>`
`(ContentType, R)` implements `Responder<'r, 'o>`
`(Status, R)` implements `Responder<'r, 'o>`
`Accepted<R>` implements `Responder<'r, 'o>`
`Arc<[u8]>` implements `Responder<'r, 'static>`
`Arc<str>` implements `Responder<'r, 'static>`
and $N others
error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
@ -26,14 +26,14 @@ error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
| ^^^^ the trait `Responder<'_, '_>` is not implemented for `bool`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
`&'o [u8]` implements `Responder<'r, 'o>`
`&'o str` implements `Responder<'r, 'o>`
`()` implements `Responder<'r, 'static>`
`(ContentType, R)` implements `Responder<'r, 'o>`
`(Status, R)` implements `Responder<'r, 'o>`
`Accepted<R>` implements `Responder<'r, 'o>`
`Arc<[u8]>` implements `Responder<'r, 'static>`
`Arc<str>` implements `Responder<'r, 'static>`
and $N others
error[E0308]: mismatched types
@ -59,14 +59,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
`&'o [u8]` implements `Responder<'r, 'o>`
`&'o str` implements `Responder<'r, 'o>`
`()` implements `Responder<'r, 'static>`
`(ContentType, R)` implements `Responder<'r, 'o>`
`(Status, R)` implements `Responder<'r, 'o>`
`Accepted<R>` implements `Responder<'r, 'o>`
`Arc<[u8]>` implements `Responder<'r, 'static>`
`Arc<str>` implements `Responder<'r, 'static>`
and $N others
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
@ -78,12 +78,12 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
`&'o [u8]` implements `Responder<'r, 'o>`
`&'o str` implements `Responder<'r, 'o>`
`()` implements `Responder<'r, 'static>`
`(ContentType, R)` implements `Responder<'r, 'o>`
`(Status, R)` implements `Responder<'r, 'o>`
`Accepted<R>` implements `Responder<'r, 'o>`
`Arc<[u8]>` implements `Responder<'r, 'static>`
`Arc<str>` implements `Responder<'r, 'static>`
and $N others

View File

@ -543,13 +543,13 @@ error[E0277]: the trait bound `bool: From<&str>` is not satisfied
| this tail expression is of type `&str`
|
= help: the following other types implement trait `From<T>`:
<bool as From<format_description::parse::format_item::HourBase>>
<bool as From<format_description::parse::format_item::MonthCaseSensitive>>
<bool as From<format_description::parse::format_item::PeriodCase>>
<bool as From<format_description::parse::format_item::PeriodCaseSensitive>>
<bool as From<format_description::parse::format_item::SignBehavior>>
<bool as From<format_description::parse::format_item::WeekdayCaseSensitive>>
<bool as From<format_description::parse::format_item::WeekdayOneIndexed>>
<bool as From<format_description::parse::format_item::YearBase>>
`bool` implements `From<format_description::parse::format_item::HourBase>`
`bool` implements `From<format_description::parse::format_item::MonthCaseSensitive>`
`bool` implements `From<format_description::parse::format_item::PeriodCase>`
`bool` implements `From<format_description::parse::format_item::PeriodCaseSensitive>`
`bool` implements `From<format_description::parse::format_item::SignBehavior>`
`bool` implements `From<format_description::parse::format_item::WeekdayCaseSensitive>`
`bool` implements `From<format_description::parse::format_item::WeekdayOneIndexed>`
`bool` implements `From<format_description::parse::format_item::YearBase>`
= note: required for `&str` to implement `Into<bool>`
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -131,15 +131,15 @@ error[E0277]: the trait bound `Unknown: FromForm<'r>` is not satisfied
7 | field: Unknown,
| ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>`
|
= help: the following other types implement trait `FromForm<'r>`:
<(A, B) as FromForm<'v>>
<Arc<T> as FromForm<'v>>
<BTreeMap<K, V> as FromForm<'v>>
<BadType3 as FromForm<'r>>
<Contextual<'v, T> as FromForm<'v>>
<HashMap<K, V> as FromForm<'v>>
<Lenient<T> as FromForm<'v>>
<Other as FromForm<'r>>
= help: the following other types implement trait `FromFormField<'v>`:
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`
@ -190,15 +190,15 @@ error[E0277]: the trait bound `Foo<usize>: FromForm<'r>` is not satisfied
14 | field: Foo<usize>,
| ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`, which is required by `Foo<usize>: FromForm<'r>`
|
= help: the following other types implement trait `FromForm<'r>`:
<(A, B) as FromForm<'v>>
<Arc<T> as FromForm<'v>>
<BTreeMap<K, V> as FromForm<'v>>
<BadType3 as FromForm<'r>>
<Contextual<'v, T> as FromForm<'v>>
<HashMap<K, V> as FromForm<'v>>
<Lenient<T> as FromForm<'v>>
<Other as FromForm<'r>>
= help: the following other types implement trait `FromFormField<'v>`:
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`

View File

@ -0,0 +1 @@
../ui-fail/from_param.rs

View File

@ -0,0 +1,53 @@
error: named structs are not supported
--> tests/ui-fail-nightly/from_param.rs:4:1
|
4 | / struct Foo1 {
5 | | a: String
6 | | }
| |_^
|
note: error occurred while deriving `FromParam`
--> tests/ui-fail-nightly/from_param.rs:3:10
|
3 | #[derive(FromParam)]
| ^^^^^^^^^
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)
error: named structs are not supported
--> tests/ui-fail-nightly/from_param.rs:9:1
|
9 | struct Foo2 {}
| ^^^^^^^^^^^^^^
|
note: error occurred while deriving `FromParam`
--> tests/ui-fail-nightly/from_param.rs:8:10
|
8 | #[derive(FromParam)]
| ^^^^^^^^^
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)
error: variants with data fields are not supported
--> tests/ui-fail-nightly/from_param.rs:13:6
|
13 | A(String),
| ^^^^^^^^
|
note: error occurred while deriving `FromParam`
--> tests/ui-fail-nightly/from_param.rs:11:10
|
11 | #[derive(FromParam)]
| ^^^^^^^^^
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> tests/ui-fail-nightly/from_param.rs:18:1
|
18 | struct Foo4(usize);
| ^^^^^^^^^^^^^^^^^^^
|
note: error occurred while deriving `FromParam`
--> tests/ui-fail-nightly/from_param.rs:17:10
|
17 | #[derive(FromParam)]
| ^^^^^^^^^
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -5,14 +5,14 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied
| ^^ the trait `Responder<'_, '_>` is not implemented for `u8`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
`&'o [u8]` implements `Responder<'r, 'o>`
`&'o str` implements `Responder<'r, 'o>`
`()` implements `Responder<'r, 'static>`
`(ContentType, R)` implements `Responder<'r, 'o>`
`(Status, R)` implements `Responder<'r, 'o>`
`Accepted<R>` implements `Responder<'r, 'o>`
`Arc<[u8]>` implements `Responder<'r, 'static>`
`Arc<str>` implements `Responder<'r, 'static>`
and $N others
error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
@ -22,14 +22,14 @@ error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
| ^^^^^^^^^ the trait `From<u8>` is not implemented for `Header<'_>`, which is required by `u8: Into<Header<'_>>`
|
= help: the following other types implement trait `From<T>`:
<Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
`Header<'static>` implements `From<&Cookie<'_>>`
`Header<'static>` implements `From<&ExpectCt>`
`Header<'static>` implements `From<&Frame>`
`Header<'static>` implements `From<&Hsts>`
`Header<'static>` implements `From<&NoSniff>`
`Header<'static>` implements `From<&Permission>`
`Header<'static>` implements `From<&Prefetch>`
`Header<'static>` implements `From<&Referrer>`
and $N others
= note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `Response::<'r>::set_header`
@ -45,14 +45,14 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied
| ^^ the trait `Responder<'_, '_>` is not implemented for `u8`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
`&'o [u8]` implements `Responder<'r, 'o>`
`&'o str` implements `Responder<'r, 'o>`
`()` implements `Responder<'r, 'static>`
`(ContentType, R)` implements `Responder<'r, 'o>`
`(Status, R)` implements `Responder<'r, 'o>`
`Accepted<R>` implements `Responder<'r, 'o>`
`Arc<[u8]>` implements `Responder<'r, 'static>`
`Arc<str>` implements `Responder<'r, 'static>`
and $N others
error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
@ -62,14 +62,14 @@ error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
| ^^^^^^^^^ the trait `From<u8>` is not implemented for `Header<'_>`, which is required by `u8: Into<Header<'_>>`
|
= help: the following other types implement trait `From<T>`:
<Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
`Header<'static>` implements `From<&Cookie<'_>>`
`Header<'static>` implements `From<&ExpectCt>`
`Header<'static>` implements `From<&Frame>`
`Header<'static>` implements `From<&Hsts>`
`Header<'static>` implements `From<&NoSniff>`
`Header<'static>` implements `From<&Permission>`
`Header<'static>` implements `From<&Prefetch>`
`Header<'static>` implements `From<&Referrer>`
and $N others
= note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `Response::<'r>::set_header`
@ -85,14 +85,14 @@ error[E0277]: the trait bound `Header<'_>: From<std::string::String>` is not sat
| ^^^^^^^^^^^^ the trait `From<std::string::String>` is not implemented for `Header<'_>`, which is required by `std::string::String: Into<Header<'_>>`
|
= help: the following other types implement trait `From<T>`:
<Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
`Header<'static>` implements `From<&Cookie<'_>>`
`Header<'static>` implements `From<&ExpectCt>`
`Header<'static>` implements `From<&Frame>`
`Header<'static>` implements `From<&Hsts>`
`Header<'static>` implements `From<&NoSniff>`
`Header<'static>` implements `From<&Permission>`
`Header<'static>` implements `From<&Prefetch>`
`Header<'static>` implements `From<&Referrer>`
and $N others
= note: required for `std::string::String` to implement `Into<Header<'_>>`
note: required by a bound in `Response::<'r>::set_header`
@ -110,14 +110,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
`&'o [u8]` implements `Responder<'r, 'o>`
`&'o str` implements `Responder<'r, 'o>`
`()` implements `Responder<'r, 'static>`
`(ContentType, R)` implements `Responder<'r, 'o>`
`(Status, R)` implements `Responder<'r, 'o>`
`Accepted<R>` implements `Responder<'r, 'o>`
`Arc<[u8]>` implements `Responder<'r, 'static>`
`Arc<str>` implements `Responder<'r, 'static>`
and $N others
note: required by a bound in `route::handler::<impl Outcome<Response<'o>, Status, (rocket::Data<'o>, Status)>>::from`
--> $WORKSPACE/core/lib/src/route/handler.rs

View File

@ -5,14 +5,14 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
`&'a str` implements `FromParam<'a>`
`IpAddr` implements `FromParam<'a>`
`Ipv4Addr` implements `FromParam<'a>`
`Ipv6Addr` implements `FromParam<'a>`
`NonZero<i128>` implements `FromParam<'a>`
`NonZero<i16>` implements `FromParam<'a>`
`NonZero<i32>` implements `FromParam<'a>`
`NonZero<i64>` implements `FromParam<'a>`
and $N others
error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied
@ -22,10 +22,10 @@ error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied
| ^ the trait `FromSegments<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromSegments<'r>`:
<PathBuf as FromSegments<'_>>
<Result<T, <T as FromSegments<'r>>::Error> as FromSegments<'r>>
<Segments<'r, rocket::http::uri::fmt::Path> as FromSegments<'r>>
<std::option::Option<T> as FromSegments<'r>>
`PathBuf` implements `FromSegments<'_>`
`Result<T, <T as FromSegments<'r>>::Error>` implements `FromSegments<'r>`
`Segments<'r, rocket::http::uri::fmt::Path>` implements `FromSegments<'r>`
`std::option::Option<T>` implements `FromSegments<'r>`
error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
--> tests/ui-fail-nightly/route-type-errors.rs:12:13
@ -104,14 +104,14 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
`&'a str` implements `FromParam<'a>`
`IpAddr` implements `FromParam<'a>`
`Ipv4Addr` implements `FromParam<'a>`
`Ipv6Addr` implements `FromParam<'a>`
`NonZero<i128>` implements `FromParam<'a>`
`NonZero<i16>` implements `FromParam<'a>`
`NonZero<i32>` implements `FromParam<'a>`
`NonZero<i64>` implements `FromParam<'a>`
and $N others
error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
@ -138,14 +138,14 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
`&'a str` implements `FromParam<'a>`
`IpAddr` implements `FromParam<'a>`
`Ipv4Addr` implements `FromParam<'a>`
`Ipv6Addr` implements `FromParam<'a>`
`NonZero<i128>` implements `FromParam<'a>`
`NonZero<i16>` implements `FromParam<'a>`
`NonZero<i32>` implements `FromParam<'a>`
`NonZero<i64>` implements `FromParam<'a>`
and $N others
error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
@ -155,12 +155,12 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
`&'a str` implements `FromParam<'a>`
`IpAddr` implements `FromParam<'a>`
`Ipv4Addr` implements `FromParam<'a>`
`Ipv6Addr` implements `FromParam<'a>`
`NonZero<i128>` implements `FromParam<'a>`
`NonZero<i16>` implements `FromParam<'a>`
`NonZero<i32>` implements `FromParam<'a>`
`NonZero<i64>` implements `FromParam<'a>`
and $N others

View File

@ -14,9 +14,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ----------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -29,9 +29,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| --------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, i64>` is not satisfied
@ -44,9 +44,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ---------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>` is not satisfied
@ -59,14 +59,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>`
| ---------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `rocket_uri_macro_not_uri_display` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -77,14 +77,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>`
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Path, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -98,9 +98,9 @@ error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, s
| ------------------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<i32 as FromUriParam<P, &'x i32>>
<i32 as FromUriParam<P, &'x mut i32>>
<i32 as FromUriParam<P, i32>>
`i32` implements `FromUriParam<P, &'x i32>`
`i32` implements `FromUriParam<P, &'x mut i32>`
`i32` implements `FromUriParam<P, i32>`
= note: required for `std::option::Option<i32>` to implement `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
= note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -114,12 +114,12 @@ error[E0277]: the trait bound `std::string::String: FromUriParam<rocket::http::u
| ------------------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<std::string::String as FromUriParam<P, &'a str>>
<std::string::String as FromUriParam<P, &'x &'a str>>
<std::string::String as FromUriParam<P, &'x mut &'a str>>
<std::string::String as FromUriParam<P, &'x mut std::string::String>>
<std::string::String as FromUriParam<P, &'x std::string::String>>
<std::string::String as FromUriParam<P, std::string::String>>
`std::string::String` implements `FromUriParam<P, &'a str>`
`std::string::String` implements `FromUriParam<P, &'x &'a str>`
`std::string::String` implements `FromUriParam<P, &'x mut &'a str>`
`std::string::String` implements `FromUriParam<P, &'x mut std::string::String>`
`std::string::String` implements `FromUriParam<P, &'x std::string::String>`
`std::string::String` implements `FromUriParam<P, std::string::String>`
= note: required for `Result<std::string::String, &str>` to implement `FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>`
= note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -133,9 +133,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| -------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
`isize` implements `FromUriParam<P, &'x isize>`
`isize` implements `FromUriParam<P, &'x mut isize>`
`isize` implements `FromUriParam<P, isize>`
= note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied
@ -148,9 +148,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| ------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
`isize` implements `FromUriParam<P, &'x isize>`
`isize` implements `FromUriParam<P, &'x mut isize>`
`isize` implements `FromUriParam<P, isize>`
= note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied
@ -163,14 +163,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| --------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -181,14 +181,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Query, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -202,14 +202,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| --------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -220,14 +220,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Query, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -271,14 +271,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -289,14 +289,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Query, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>`
`&'a [u8]` implements `FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>`
`&'a std::path::Path` implements `FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>`
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -310,9 +310,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ----------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefix` is not satisfied
@ -343,9 +343,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ---------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is not satisfied
@ -376,9 +376,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied
@ -391,10 +391,10 @@ error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix<roc
| required by a bound introduced by this call
|
= help: the following other types implement trait `ValidRouteSuffix<T>`:
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
`rocket::http::uri::Absolute<'a>` implements `ValidRouteSuffix<rocket::http::uri::Absolute<'a>>`
`rocket::http::uri::Absolute<'a>` implements `ValidRouteSuffix<rocket::http::uri::Origin<'a>>`
`rocket::http::uri::Reference<'a>` implements `ValidRouteSuffix<rocket::http::uri::Absolute<'a>>`
`rocket::http::uri::Reference<'a>` implements `ValidRouteSuffix<rocket::http::uri::Origin<'a>>`
note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -413,9 +413,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| -------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied
@ -428,10 +428,10 @@ error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix<r
| required by a bound introduced by this call
|
= help: the following other types implement trait `ValidRouteSuffix<T>`:
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
`rocket::http::uri::Absolute<'a>` implements `ValidRouteSuffix<rocket::http::uri::Absolute<'a>>`
`rocket::http::uri::Absolute<'a>` implements `ValidRouteSuffix<rocket::http::uri::Origin<'a>>`
`rocket::http::uri::Reference<'a>` implements `ValidRouteSuffix<rocket::http::uri::Absolute<'a>>`
`rocket::http::uri::Reference<'a>` implements `ValidRouteSuffix<rocket::http::uri::Origin<'a>>`
note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -447,9 +447,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -459,9 +459,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, i64>` is not satisfied
@ -471,9 +471,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^^^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, i64>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` is not satisfied
@ -483,9 +483,9 @@ error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, s
| ^^^^^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` is not implemented for `i32`, which is required by `std::option::Option<i32>: FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<i32 as FromUriParam<P, &'x i32>>
<i32 as FromUriParam<P, &'x mut i32>>
<i32 as FromUriParam<P, i32>>
`i32` implements `FromUriParam<P, &'x i32>`
`i32` implements `FromUriParam<P, &'x mut i32>`
`i32` implements `FromUriParam<P, i32>`
= note: required for `std::option::Option<i32>` to implement `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -496,9 +496,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Query, &str>` is not implemented for `isize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
`isize` implements `FromUriParam<P, &'x isize>`
`isize` implements `FromUriParam<P, &'x mut isize>`
`isize` implements `FromUriParam<P, isize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied
@ -508,9 +508,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Query, &str>` is not implemented for `isize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
`isize` implements `FromUriParam<P, &'x isize>`
`isize` implements `FromUriParam<P, &'x mut isize>`
`isize` implements `FromUriParam<P, isize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -520,9 +520,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -532,9 +532,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -544,9 +544,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -556,7 +556,7 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
`usize` implements `FromUriParam<P, &'x mut usize>`
`usize` implements `FromUriParam<P, &'x usize>`
`usize` implements `FromUriParam<P, usize>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -5,14 +5,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
`&T` implements `UriDisplay<P>`
`&mut T` implements `UriDisplay<P>`
`BTreeMap<K, V>` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar1` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar2` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar3` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar4` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar5` implements `UriDisplay<rocket::http::uri::fmt::Query>`
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
@ -28,14 +28,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
`&T` implements `UriDisplay<P>`
`&mut T` implements `UriDisplay<P>`
`BTreeMap<K, V>` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar1` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar2` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar3` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar4` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar5` implements `UriDisplay<rocket::http::uri::fmt::Query>`
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
@ -51,14 +51,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
`&T` implements `UriDisplay<P>`
`&mut T` implements `UriDisplay<P>`
`BTreeMap<K, V>` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar1` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar2` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar3` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar4` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar5` implements `UriDisplay<rocket::http::uri::fmt::Query>`
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
@ -74,14 +74,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
`&T` implements `UriDisplay<P>`
`&mut T` implements `UriDisplay<P>`
`BTreeMap<K, V>` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar1` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar2` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar3` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar4` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar5` implements `UriDisplay<rocket::http::uri::fmt::Query>`
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
@ -99,14 +99,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
`&T` implements `UriDisplay<P>`
`&mut T` implements `UriDisplay<P>`
`BTreeMap<K, V>` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar1` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar2` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar3` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar4` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar5` implements `UriDisplay<rocket::http::uri::fmt::Query>`
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
@ -124,14 +124,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
`&T` implements `UriDisplay<P>`
`&mut T` implements `UriDisplay<P>`
`BTreeMap<K, V>` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar1` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar2` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar3` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar4` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar5` implements `UriDisplay<rocket::http::uri::fmt::Query>`
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
@ -149,14 +149,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Path>
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Path>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Path>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
`&T` implements `UriDisplay<P>`
`&mut T` implements `UriDisplay<P>`
`BTreeMap<K, V>` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar1` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar2` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar3` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar4` implements `UriDisplay<rocket::http::uri::fmt::Query>`
`Bar5` implements `UriDisplay<rocket::http::uri::fmt::Query>`
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Path>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`

View File

@ -103,7 +103,7 @@ error[E0728]: `await` is only allowed inside `async` functions and blocks
--> tests/ui-fail-stable/async-entry.rs:73:42
|
72 | fn rocket() -> _ {
| ------ this is not `async`
| ---------------- this is not `async`
73 | let _ = rocket::build().launch().await;
| ^^^^^ only allowed inside `async` functions and blocks

View File

@ -7,14 +7,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<rocket::either::Either<T, E> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<rocket::serde::json::Value as Responder<'r, 'static>>
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and $N others
error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
@ -26,14 +26,14 @@ error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
| ^^^^ the trait `Responder<'_, '_>` is not implemented for `bool`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<rocket::either::Either<T, E> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<rocket::serde::json::Value as Responder<'r, 'static>>
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and $N others
error[E0308]: mismatched types
@ -59,14 +59,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<rocket::either::Either<T, E> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<rocket::serde::json::Value as Responder<'r, 'static>>
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and $N others
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
@ -78,12 +78,12 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<rocket::either::Either<T, E> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<rocket::serde::json::Value as Responder<'r, 'static>>
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and $N others

View File

@ -5,14 +5,14 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
| ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`
@ -28,14 +28,14 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
| |_______________^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `_::FromFormGeneratedContext<'r>: std::marker::Send`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`
note: required because it appears within the type `_::FromFormGeneratedContext<'r>`
@ -59,14 +59,14 @@ error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
| ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`, which is required by `Foo<usize>: FromForm<'r>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`
@ -82,14 +82,14 @@ error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
| |____________^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`, which is required by `_::FromFormGeneratedContext<'r>: std::marker::Send`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`
note: required because it appears within the type `_::FromFormGeneratedContext<'r>`
@ -113,14 +113,14 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
| ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -132,14 +132,14 @@ error[E0277]: the trait bound `Unknown: FromForm<'r>` is not satisfied
| ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>`
|
= help: the following other types implement trait `FromForm<'r>`:
<BadType3 as FromForm<'r>>
<Other as FromForm<'r>>
<HashMap<K, V> as FromForm<'v>>
<BTreeMap<K, V> as FromForm<'v>>
<(A, B) as FromForm<'v>>
<Arc<T> as FromForm<'v>>
<Vec<T> as FromForm<'v>>
<form::from_form::_::proxy::Range<T> as FromForm<'r>>
<form::from_form::_::proxy::RangeFrom<T> as FromForm<'r>>
<BTreeMap<K, V> as FromForm<'v>>
<BadType3 as FromForm<'r>>
<Contextual<'v, T> as FromForm<'v>>
<HashMap<K, V> as FromForm<'v>>
<Lenient<T> as FromForm<'v>>
<Other as FromForm<'r>>
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`
@ -153,14 +153,14 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
| ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -172,14 +172,14 @@ error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
| ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`, which is required by `Foo<usize>: FromForm<'r>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -191,14 +191,14 @@ error[E0277]: the trait bound `Foo<usize>: FromForm<'r>` is not satisfied
| ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`, which is required by `Foo<usize>: FromForm<'r>`
|
= help: the following other types implement trait `FromForm<'r>`:
<BadType3 as FromForm<'r>>
<Other as FromForm<'r>>
<HashMap<K, V> as FromForm<'v>>
<BTreeMap<K, V> as FromForm<'v>>
<(A, B) as FromForm<'v>>
<Arc<T> as FromForm<'v>>
<Vec<T> as FromForm<'v>>
<form::from_form::_::proxy::Range<T> as FromForm<'r>>
<form::from_form::_::proxy::RangeFrom<T> as FromForm<'r>>
<BTreeMap<K, V> as FromForm<'v>>
<BadType3 as FromForm<'r>>
<Contextual<'v, T> as FromForm<'v>>
<HashMap<K, V> as FromForm<'v>>
<Lenient<T> as FromForm<'v>>
<Other as FromForm<'r>>
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`
@ -212,14 +212,14 @@ error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
| ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`, which is required by `Foo<usize>: FromForm<'r>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -0,0 +1 @@
../ui-fail/from_param.rs

View File

@ -0,0 +1,57 @@
error: named structs are not supported
--> tests/ui-fail-stable/from_param.rs:4:1
|
4 | / struct Foo1 {
5 | | a: String
6 | | }
| |_^
error: [note] error occurred while deriving `FromParam`
--> tests/ui-fail-stable/from_param.rs:3:10
|
3 | #[derive(FromParam)]
| ^^^^^^^^^
|
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)
error: named structs are not supported
--> tests/ui-fail-stable/from_param.rs:9:1
|
9 | struct Foo2 {}
| ^^^^^^^^^^^^^^
error: [note] error occurred while deriving `FromParam`
--> tests/ui-fail-stable/from_param.rs:8:10
|
8 | #[derive(FromParam)]
| ^^^^^^^^^
|
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)
error: variants with data fields are not supported
--> tests/ui-fail-stable/from_param.rs:13:6
|
13 | A(String),
| ^^^^^^^^
error: [note] error occurred while deriving `FromParam`
--> tests/ui-fail-stable/from_param.rs:11:10
|
11 | #[derive(FromParam)]
| ^^^^^^^^^
|
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> tests/ui-fail-stable/from_param.rs:18:1
|
18 | struct Foo4(usize);
| ^^^^^^^^^^^^^^^^^^^
error: [note] error occurred while deriving `FromParam`
--> tests/ui-fail-stable/from_param.rs:17:10
|
17 | #[derive(FromParam)]
| ^^^^^^^^^
|
= note: this error originates in the derive macro `FromParam` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -5,14 +5,14 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied
| ^^ the trait `Responder<'_, '_>` is not implemented for `u8`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<Thing1 as Responder<'r, 'o>>
<Thing2 as Responder<'r, 'o>>
<Thing3 as Responder<'r, 'o>>
<Thing4 as Responder<'r, 'o>>
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<rocket::either::Either<T, E> as Responder<'r, 'o>>
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and $N others
error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
@ -22,14 +22,14 @@ error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
| ^^^^^^^^^ the trait `From<u8>` is not implemented for `Header<'_>`, which is required by `u8: Into<Header<'_>>`
|
= help: the following other types implement trait `From<T>`:
<Header<'static> as From<Cookie<'_>>>
<Header<'static> as From<ContentType>>
<Header<'static> as From<Accept>>
<Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&Referrer>>
<Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
and $N others
= note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `Response::<'r>::set_header`
@ -45,14 +45,14 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied
| ^^ the trait `Responder<'_, '_>` is not implemented for `u8`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<Thing1 as Responder<'r, 'o>>
<Thing2 as Responder<'r, 'o>>
<Thing3 as Responder<'r, 'o>>
<Thing4 as Responder<'r, 'o>>
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<rocket::either::Either<T, E> as Responder<'r, 'o>>
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and $N others
error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
@ -62,14 +62,14 @@ error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
| ^^^^^^^^^ the trait `From<u8>` is not implemented for `Header<'_>`, which is required by `u8: Into<Header<'_>>`
|
= help: the following other types implement trait `From<T>`:
<Header<'static> as From<Cookie<'_>>>
<Header<'static> as From<ContentType>>
<Header<'static> as From<Accept>>
<Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&Referrer>>
<Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
and $N others
= note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `Response::<'r>::set_header`
@ -85,14 +85,14 @@ error[E0277]: the trait bound `Header<'_>: From<std::string::String>` is not sat
| ^^^^^^^^^^^^ the trait `From<std::string::String>` is not implemented for `Header<'_>`, which is required by `std::string::String: Into<Header<'_>>`
|
= help: the following other types implement trait `From<T>`:
<Header<'static> as From<Cookie<'_>>>
<Header<'static> as From<ContentType>>
<Header<'static> as From<Accept>>
<Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&Referrer>>
<Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
and $N others
= note: required for `std::string::String` to implement `Into<Header<'_>>`
note: required by a bound in `Response::<'r>::set_header`
@ -110,14 +110,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<Thing1 as Responder<'r, 'o>>
<Thing2 as Responder<'r, 'o>>
<Thing3 as Responder<'r, 'o>>
<Thing4 as Responder<'r, 'o>>
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<rocket::either::Either<T, E> as Responder<'r, 'o>>
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and $N others
note: required by a bound in `route::handler::<impl Outcome<Response<'o>, Status, (rocket::Data<'o>, Status)>>::from`
--> $WORKSPACE/core/lib/src/route/handler.rs

View File

@ -5,14 +5,14 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<bool as FromParam<'a>>
<isize as FromParam<'a>>
<i8 as FromParam<'a>>
<i16 as FromParam<'a>>
<i32 as FromParam<'a>>
<i64 as FromParam<'a>>
<i128 as FromParam<'a>>
<usize as FromParam<'a>>
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
and $N others
error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied
@ -22,10 +22,10 @@ error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied
| ^ the trait `FromSegments<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromSegments<'r>`:
<Segments<'r, rocket::http::uri::fmt::Path> as FromSegments<'r>>
<PathBuf as FromSegments<'_>>
<std::option::Option<T> as FromSegments<'r>>
<Result<T, <T as FromSegments<'r>>::Error> as FromSegments<'r>>
<Segments<'r, rocket::http::uri::fmt::Path> as FromSegments<'r>>
<std::option::Option<T> as FromSegments<'r>>
error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:12:13
@ -34,14 +34,14 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
| ^ the trait `FromFormField<'_>` is not implemented for `Q`, which is required by `Q: FromForm<'_>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Q` to implement `FromForm<'_>`
@ -52,14 +52,14 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
| ^ the trait `FromFormField<'_>` is not implemented for `Q`, which is required by `Q: FromForm<'_>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
char
isize
i8
i16
i32
i64
i128
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
and $N others
= note: required for `Q` to implement `FromForm<'_>`
@ -70,14 +70,14 @@ error[E0277]: the trait bound `Q: FromData<'_>` is not satisfied
| ^ the trait `FromData<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromData<'r>`:
rocket::Data<'r>
Cow<'_, str>
Capped<Cow<'_, str>>
Capped<Vec<u8>>
Capped<std::string::String>
Capped<TempFile<'_>>
Capped<&'r str>
&'r RawStr
&'r [u8]
&'r str
Capped<&'r RawStr>
Capped<&'r [u8]>
Capped<&'r str>
Capped<Cow<'_, str>>
Capped<TempFile<'_>>
and $N others
error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
@ -87,14 +87,14 @@ error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
| ^ the trait `FromRequest<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromRequest<'r>`:
ProxyProto<'r>
Method
Outcome<T, (Status, <T as FromRequest<'r>>::Error), Status>
Flash<&'r CookieJar<'r>>
rocket::Shutdown
IpAddr
std::net::SocketAddr
std::option::Option<T>
&'r Accept
&'r ContentType
&'r CookieJar<'r>
&'r Endpoint
&'r Host<'r>
&'r Limits
&'r Route
&'r rocket::Config
and $N others
error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
@ -104,14 +104,14 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<bool as FromParam<'a>>
<isize as FromParam<'a>>
<i8 as FromParam<'a>>
<i16 as FromParam<'a>>
<i32 as FromParam<'a>>
<i64 as FromParam<'a>>
<i128 as FromParam<'a>>
<usize as FromParam<'a>>
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
and $N others
error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
@ -121,14 +121,14 @@ error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
| ^ the trait `FromRequest<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromRequest<'r>`:
ProxyProto<'r>
Method
Outcome<T, (Status, <T as FromRequest<'r>>::Error), Status>
Flash<&'r CookieJar<'r>>
rocket::Shutdown
IpAddr
std::net::SocketAddr
std::option::Option<T>
&'r Accept
&'r ContentType
&'r CookieJar<'r>
&'r Endpoint
&'r Host<'r>
&'r Limits
&'r Route
&'r rocket::Config
and $N others
error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
@ -138,14 +138,14 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<bool as FromParam<'a>>
<isize as FromParam<'a>>
<i8 as FromParam<'a>>
<i16 as FromParam<'a>>
<i32 as FromParam<'a>>
<i64 as FromParam<'a>>
<i128 as FromParam<'a>>
<usize as FromParam<'a>>
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
and $N others
error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
@ -155,12 +155,12 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
| ^ the trait `FromParam<'_>` is not implemented for `Q`
|
= help: the following other types implement trait `FromParam<'a>`:
<bool as FromParam<'a>>
<isize as FromParam<'a>>
<i8 as FromParam<'a>>
<i16 as FromParam<'a>>
<i32 as FromParam<'a>>
<i64 as FromParam<'a>>
<i128 as FromParam<'a>>
<usize as FromParam<'a>>
<&'a str as FromParam<'a>>
<IpAddr as FromParam<'a>>
<Ipv4Addr as FromParam<'a>>
<Ipv6Addr as FromParam<'a>>
<NonZero<i128> as FromParam<'a>>
<NonZero<i16> as FromParam<'a>>
<NonZero<i32> as FromParam<'a>>
<NonZero<i64> as FromParam<'a>>
and $N others

View File

@ -14,9 +14,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ----------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -29,9 +29,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| --------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, i64>` is not satisfied
@ -44,9 +44,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ---------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>` is not satisfied
@ -59,14 +59,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>`
| ---------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `rocket_uri_macro_not_uri_display` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -77,14 +77,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>`
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Path, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -98,9 +98,9 @@ error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, s
| ------------------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<i32 as FromUriParam<P, i32>>
<i32 as FromUriParam<P, &'x i32>>
<i32 as FromUriParam<P, &'x mut i32>>
<i32 as FromUriParam<P, i32>>
= note: required for `std::option::Option<i32>` to implement `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
= note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -114,12 +114,12 @@ error[E0277]: the trait bound `std::string::String: FromUriParam<rocket::http::u
| ------------------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<std::string::String as FromUriParam<P, std::string::String>>
<std::string::String as FromUriParam<P, &'x std::string::String>>
<std::string::String as FromUriParam<P, &'x mut std::string::String>>
<std::string::String as FromUriParam<P, &'a str>>
<std::string::String as FromUriParam<P, &'x &'a str>>
<std::string::String as FromUriParam<P, &'x mut &'a str>>
<std::string::String as FromUriParam<P, &'x mut std::string::String>>
<std::string::String as FromUriParam<P, &'x std::string::String>>
<std::string::String as FromUriParam<P, std::string::String>>
= note: required for `Result<std::string::String, &str>` to implement `FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>`
= note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -133,9 +133,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| -------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
= note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied
@ -148,9 +148,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| ------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
= note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied
@ -163,14 +163,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| --------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -181,14 +181,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Query, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -202,14 +202,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| --------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -220,14 +220,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Query, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -238,8 +238,8 @@ error[E0277]: the trait bound `S: Ignorable<rocket::http::uri::fmt::Query>` is n
| ^ the trait `Ignorable<rocket::http::uri::fmt::Query>` is not implemented for `S`
|
= help: the following other types implement trait `Ignorable<P>`:
std::option::Option<T>
Result<T, E>
std::option::Option<T>
note: required by a bound in `assert_ignorable`
--> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs
|
@ -253,8 +253,8 @@ error[E0277]: the trait bound `usize: Ignorable<rocket::http::uri::fmt::Query>`
| ^ the trait `Ignorable<rocket::http::uri::fmt::Query>` is not implemented for `usize`
|
= help: the following other types implement trait `Ignorable<P>`:
std::option::Option<T>
Result<T, E>
std::option::Option<T>
note: required by a bound in `assert_ignorable`
--> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs
|
@ -271,14 +271,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -289,14 +289,14 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
| ^ the trait `FromUriParam<rocket::http::uri::fmt::Query, _>` is not implemented for `S`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<bool as FromUriParam<P, bool>>
<bool as FromUriParam<P, &'x bool>>
<bool as FromUriParam<P, &'x mut bool>>
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<i8 as FromUriParam<P, i8>>
<i8 as FromUriParam<P, &'x i8>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x &'a [u8]>>
<&'a [u8] as FromUriParam<rocket::http::uri::fmt::Query, &'x mut &'a [u8]>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x PathBuf>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut &'a std::path::Path>>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, &'x mut PathBuf>>
and $N others
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -310,9 +310,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ----------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefix` is not satisfied
@ -325,8 +325,8 @@ error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefi
| required by a bound introduced by this call
|
= help: the following other types implement trait `ValidRoutePrefix`:
rocket::http::uri::Origin<'a>
rocket::http::uri::Absolute<'a>
rocket::http::uri::Origin<'a>
note: required by a bound in `RouteUriBuilder::with_prefix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -343,9 +343,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ---------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is not satisfied
@ -358,8 +358,8 @@ error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is
| required by a bound introduced by this call
|
= help: the following other types implement trait `ValidRoutePrefix`:
rocket::http::uri::Origin<'a>
rocket::http::uri::Absolute<'a>
rocket::http::uri::Origin<'a>
note: required by a bound in `RouteUriBuilder::with_prefix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -376,9 +376,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied
@ -391,10 +391,10 @@ error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix<roc
| required by a bound introduced by this call
|
= help: the following other types implement trait `ValidRouteSuffix<T>`:
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -413,9 +413,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| -------------------------------------------- in this macro invocation
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied
@ -428,10 +428,10 @@ error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix<r
| required by a bound introduced by this call
|
= help: the following other types implement trait `ValidRouteSuffix<T>`:
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -447,9 +447,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -459,9 +459,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, i64>` is not satisfied
@ -471,9 +471,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^^^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, i64>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` is not satisfied
@ -483,9 +483,9 @@ error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, s
| ^^^^^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` is not implemented for `i32`, which is required by `std::option::Option<i32>: FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<i32 as FromUriParam<P, i32>>
<i32 as FromUriParam<P, &'x i32>>
<i32 as FromUriParam<P, &'x mut i32>>
<i32 as FromUriParam<P, i32>>
= note: required for `std::option::Option<i32>` to implement `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -496,9 +496,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Query, &str>` is not implemented for `isize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied
@ -508,9 +508,9 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Query, &str>` is not implemented for `isize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<isize as FromUriParam<P, isize>>
<isize as FromUriParam<P, &'x isize>>
<isize as FromUriParam<P, &'x mut isize>>
<isize as FromUriParam<P, isize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -520,9 +520,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -532,9 +532,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -544,9 +544,9 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
@ -556,7 +556,7 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
| ^^^^ the trait `FromUriParam<rocket::http::uri::fmt::Path, &str>` is not implemented for `usize`
|
= help: the following other types implement trait `FromUriParam<P, T>`:
<usize as FromUriParam<P, usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, &'x mut usize>>
<usize as FromUriParam<P, &'x usize>>
<usize as FromUriParam<P, usize>>
= note: this error originates in the macro `::rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -5,14 +5,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<bool as UriDisplay<P>>
<isize as UriDisplay<P>>
<i8 as UriDisplay<P>>
<i16 as UriDisplay<P>>
<i32 as UriDisplay<P>>
<i64 as UriDisplay<P>>
<i128 as UriDisplay<P>>
<usize as UriDisplay<P>>
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
@ -28,14 +28,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<bool as UriDisplay<P>>
<isize as UriDisplay<P>>
<i8 as UriDisplay<P>>
<i16 as UriDisplay<P>>
<i32 as UriDisplay<P>>
<i64 as UriDisplay<P>>
<i128 as UriDisplay<P>>
<usize as UriDisplay<P>>
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
@ -51,14 +51,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<bool as UriDisplay<P>>
<isize as UriDisplay<P>>
<i8 as UriDisplay<P>>
<i16 as UriDisplay<P>>
<i32 as UriDisplay<P>>
<i64 as UriDisplay<P>>
<i128 as UriDisplay<P>>
<usize as UriDisplay<P>>
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
@ -74,14 +74,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<bool as UriDisplay<P>>
<isize as UriDisplay<P>>
<i8 as UriDisplay<P>>
<i16 as UriDisplay<P>>
<i32 as UriDisplay<P>>
<i64 as UriDisplay<P>>
<i128 as UriDisplay<P>>
<usize as UriDisplay<P>>
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
@ -99,14 +99,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<bool as UriDisplay<P>>
<isize as UriDisplay<P>>
<i8 as UriDisplay<P>>
<i16 as UriDisplay<P>>
<i32 as UriDisplay<P>>
<i64 as UriDisplay<P>>
<i128 as UriDisplay<P>>
<usize as UriDisplay<P>>
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
@ -124,14 +124,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
| ^^^^^^^^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay<rocket::http::uri::fmt::Query>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<bool as UriDisplay<P>>
<isize as UriDisplay<P>>
<i8 as UriDisplay<P>>
<i16 as UriDisplay<P>>
<i32 as UriDisplay<P>>
<i64 as UriDisplay<P>>
<i128 as UriDisplay<P>>
<usize as UriDisplay<P>>
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
@ -149,14 +149,14 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Path>
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Path>` is not implemented for `BadType`, which is required by `&BadType: UriDisplay<rocket::http::uri::fmt::Path>`
|
= help: the following other types implement trait `UriDisplay<P>`:
<bool as UriDisplay<P>>
<isize as UriDisplay<P>>
<i8 as UriDisplay<P>>
<i16 as UriDisplay<P>>
<i32 as UriDisplay<P>>
<i64 as UriDisplay<P>>
<i128 as UriDisplay<P>>
<usize as UriDisplay<P>>
<&T as UriDisplay<P>>
<&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and $N others
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Path>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`

View File

@ -0,0 +1,20 @@
use rocket::request::FromParam;
#[derive(FromParam)]
struct Foo1 {
a: String
}
#[derive(FromParam)]
struct Foo2 {}
#[derive(FromParam)]
enum Foo3 {
A(String),
B(String)
}
#[derive(FromParam)]
struct Foo4(usize);
fn main() {}

View File

@ -316,6 +316,12 @@ pub struct ParseMethodError;
impl std::error::Error for ParseMethodError { }
impl From<std::convert::Infallible> for ParseMethodError {
fn from(infallible: std::convert::Infallible) -> Self {
match infallible {}
}
}
impl fmt::Display for ParseMethodError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("invalid HTTP method")
@ -331,6 +337,14 @@ impl FromStr for Method {
}
}
impl TryFrom<&str> for Method {
type Error = ParseMethodError;
fn try_from(s: &str) -> Result<Self, Self::Error> {
Self::try_from(s.as_bytes())
}
}
impl AsRef<str> for Method {
fn as_ref(&self) -> &str {
self.as_str()

View File

@ -112,7 +112,7 @@ impl StatusClass {
/// }
/// # }
/// ```
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Status {
/// The HTTP status code associated with this status.
pub code: u16,
@ -354,32 +354,6 @@ impl fmt::Display for Status {
}
}
impl std::hash::Hash for Status {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.code.hash(state)
}
}
impl PartialEq for Status {
fn eq(&self, other: &Self) -> bool {
self.code.eq(&other.code)
}
}
impl Eq for Status { }
impl PartialOrd for Status {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl Ord for Status {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.code.cmp(&other.code)
}
}
#[cfg(feature = "serde")]
mod serde_impl {
use super::*;

View File

@ -33,7 +33,7 @@ uuid = ["uuid_", "rocket_http/uuid"]
tls = ["rustls", "tokio-rustls", "rustls-pemfile"]
mtls = ["tls", "x509-parser"]
tokio-macros = ["tokio/macros"]
trace = ["tracing-subscriber", "tinyvec", "thread_local", "rustls?/logging", "tokio-rustls?/logging", "multer/log"]
trace = ["tracing-subscriber", "tinyvec", "thread_local", "rustls?/logging", "tokio-rustls?/logging", "multer/log", "s2n-quic-h3?/tracing"]
[dependencies]
# Optional serialization dependencies.
@ -128,6 +128,7 @@ optional = true
[dependencies.s2n-quic-h3]
git = "https://github.com/SergioBenitez/s2n-quic-h3.git"
rev = "7aa3be0"
optional = true
[target.'cfg(unix)'.dependencies]

View File

@ -1,17 +1,10 @@
use std::fmt;
use cookie::Key;
use serde::{de, ser, Deserialize, Serialize};
use serde::{de, ser, Deserialize};
use crate::request::{Outcome, Request, FromRequest};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
enum Kind {
Zero,
Generated,
Provided
}
/// A cryptographically secure secret key.
///
/// A `SecretKey` is primarily used by [private cookies]. See the [configuration

View File

@ -89,6 +89,60 @@ pub enum ErrorKind {
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Empty;
/// An error that occurs when a value doesn't match one of the expected options.
///
/// This error is returned by the [`FromParam`] trait implementation generated
/// by the [`FromParam` derive](macro@rocket::FromParam) when the value of a
/// dynamic path segment does not match one of the expected variants. The
/// `value` field will contain the value that was provided, and `options` will
/// contain each of possible stringified variants.
///
/// [`FromParam`]: trait@rocket::request::FromParam
///
/// # Example
///
/// ```rust
/// # #[macro_use] extern crate rocket;
/// use rocket::error::InvalidOption;
///
/// #[derive(FromParam)]
/// enum MyParam {
/// FirstOption,
/// SecondOption,
/// ThirdOption,
/// }
///
/// #[get("/<param>")]
/// fn hello(param: Result<MyParam, InvalidOption<'_>>) {
/// if let Err(e) = param {
/// assert_eq!(e.options, &["FirstOption", "SecondOption", "ThirdOption"]);
/// }
/// }
/// ```
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct InvalidOption<'a> {
/// The value that was provided.
pub value: &'a str,
/// The expected values: a slice of strings, one for each possible value.
pub options: &'static [&'static str],
}
impl<'a> InvalidOption<'a> {
#[doc(hidden)]
pub fn new(value: &'a str, options: &'static [&'static str]) -> Self {
Self { value, options }
}
}
impl fmt::Display for InvalidOption<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "unexpected value {:?}, expected one of {:?}", self.value, self.options)
}
}
impl std::error::Error for InvalidOption<'_> {}
impl Error {
#[inline(always)]
pub(crate) fn new(kind: ErrorKind) -> Error {

View File

@ -48,10 +48,10 @@ pub struct QuicListener {
tls: TlsConfig,
}
pub struct H3Stream(H3Conn);
pub struct H3Stream(H3Conn, quic::connection::Result<SocketAddr>);
pub struct H3Connection {
pub(crate) handle: quic::connection::Handle,
pub(crate) remote: quic::connection::Result<SocketAddr>,
pub(crate) parts: http::request::Parts,
pub(crate) tx: QuicTx,
pub(crate) rx: QuicRx,
@ -104,9 +104,10 @@ impl QuicListener {
}
pub async fn connect(&self, accept: quic::Connection) -> io::Result<H3Stream> {
let remote = accept.remote_addr();
let quic_conn = quic_h3::Connection::new(accept);
let conn = H3Conn::new(quic_conn).await.map_err(io::Error::other)?;
Ok(H3Stream(conn))
Ok(H3Stream(conn, remote))
}
pub fn endpoint(&self) -> io::Result<Endpoint> {
@ -116,7 +117,7 @@ impl QuicListener {
impl H3Stream {
pub async fn accept(&mut self) -> io::Result<Option<H3Connection>> {
let handle = self.0.inner.conn.handle().clone();
let remote = self.1.clone();
let ((parts, _), (tx, rx)) = match self.0.accept().await {
Ok(Some((req, stream))) => (req.into_parts(), stream.split()),
Ok(None) => return Ok(None),
@ -129,7 +130,7 @@ impl H3Stream {
}
};
Ok(Some(H3Connection { handle, parts, tx: QuicTx(tx), rx: QuicRx(rx) }))
Ok(Some(H3Connection { remote, parts, tx: QuicTx(tx), rx: QuicRx(rx) }))
}
}
@ -158,8 +159,7 @@ impl QuicTx {
// FIXME: Expose certificates when possible.
impl H3Connection {
pub fn endpoint(&self) -> io::Result<Endpoint> {
let addr = self.handle.remote_addr()?;
Ok(Endpoint::Quic(addr).assume_tls())
Ok(Endpoint::Quic(self.remote?).assume_tls())
}
}

View File

@ -12,6 +12,11 @@ use crate::http::uri::{Segments, error::PathError, fmt::Path};
/// a dynamic segment `<param>` where `param` has some type `T` that implements
/// `FromParam`, `T::from_param` will be called.
///
/// # Deriving
///
/// The `FromParam` trait can be automatically derived for C-like enums. See
/// [`FromParam` derive](macro@rocket::FromParam) for more information.
///
/// # Forwarding
///
/// If the conversion fails, the incoming request will be forwarded to the next

View File

@ -12,6 +12,9 @@ pub use self::request::Request;
pub use self::from_request::{FromRequest, Outcome};
pub use self::from_param::{FromParam, FromSegments};
#[doc(hidden)]
pub use rocket_codegen::FromParam;
#[doc(inline)]
pub use crate::response::flash::FlashMessage;

View File

@ -2,6 +2,7 @@ use std::{io, fmt};
use std::ops::RangeFrom;
use std::sync::{Arc, atomic::Ordering};
use std::borrow::Cow;
use std::str::FromStr;
use std::future::Future;
use std::net::IpAddr;
@ -1086,7 +1087,7 @@ impl<'r> Request<'r> {
// Keep track of parsing errors; emit a `BadRequest` if any exist.
let mut errors = vec![];
// Ensure that the method is known. TODO: Allow made-up methods?
// Ensure that the method is known.
let method = match hyper.method {
hyper::Method::GET => Method::Get,
hyper::Method::PUT => Method::Put,
@ -1097,10 +1098,10 @@ impl<'r> Request<'r> {
hyper::Method::TRACE => Method::Trace,
hyper::Method::CONNECT => Method::Connect,
hyper::Method::PATCH => Method::Patch,
_ => {
ref ext => Method::from_str(ext.as_str()).unwrap_or_else(|_| {
errors.push(RequestError::BadMethod(hyper.method.clone()));
Method::Get
}
}),
};
// TODO: Keep around not just the path/query, but the rest, if there?

View File

@ -193,7 +193,7 @@ impl Rocket<Build> {
/// Overrides the current configuration provider with `provider`.
///
/// The default provider, or a provider previously set with
/// [`Rocket::custom()`] or [`Rocket::reconfigure()`], is overriden by
/// [`Rocket::custom()`] or [`Rocket::reconfigure()`], is overridden by
/// `provider`.
///
/// # Example

View File

@ -353,7 +353,7 @@ pub struct Sentry {
}
impl Sentry {
/// Returns the type ID of the resolved sentinal type.
/// Returns the type ID of the resolved sentinel type.
///
/// # Example
///
@ -368,7 +368,7 @@ impl Sentry {
self.type_id
}
/// Returns the type name of the resolved sentinal type.
/// Returns the type name of the resolved sentinel type.
///
/// # Example
///

View File

@ -43,9 +43,8 @@ pub use rmp_serde::decode::Error;
///
/// ## Sending MessagePack
///
/// To respond with serialized MessagePack data, return a `MsgPack<T>` type,
/// where `T` implements [`Serialize`] from [`serde`]. The content type of the
/// response is set to `application/msgpack` automatically.
/// To respond with serialized MessagePack data, return either [`MsgPack<T>`] or
/// [`Compact<T>`] from your handler. `T` must implement [`serde::Serialize`].
///
/// ```rust
/// # #[macro_use] extern crate rocket;
@ -60,6 +59,10 @@ pub use rmp_serde::decode::Error;
/// }
/// ```
///
/// The differences between [`MsgPack<T>`] and [`Compact<T>`] are documented on
/// [`Compact<T>`]. In most cases, [`MsgPack<T>`] is preferable, although compact
/// was the default prior to Rocket version 0.6.
///
/// ## Receiving MessagePack
///
/// `MsgPack` is both a data guard and a form guard.
@ -123,9 +126,35 @@ pub use rmp_serde::decode::Error;
/// msgpack = 5242880
/// ```
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MsgPack<T>(pub T);
pub struct MsgPack<T, const COMPACT: bool = false>(pub T);
impl<T> MsgPack<T> {
/// Serializes responses in a compact MesagePack format, where structs are
/// serialized as arrays of their field values.
///
/// To respond with compact MessagePack data, return a `Compact<T>` type,
/// where `T` implements [`Serialize`] from [`serde`]. The content type of the
/// response is set to `application/msgpack` automatically.
///
/// ```rust
/// # #[macro_use] extern crate rocket;
/// # type User = usize;
/// use rocket::serde::msgpack;
///
/// #[get("/users/<id>")]
/// fn user(id: usize) -> msgpack::Compact<User> {
/// let user_from_id = User::from(id);
/// /* ... */
/// msgpack::MsgPack(user_from_id)
/// }
/// ```
///
/// Prefer using [`MsgPack<T>`] for request guards, as the named/compact
/// distinction is not relevant for request data - the correct option is
/// implemented automatically. Using [`Compact<T>`] as a request guard will
/// NOT prevent named requests from being accepted.
pub type Compact<T> = MsgPack<T, true>;
impl<T, const COMPACT: bool> MsgPack<T, COMPACT> {
/// Consumes the `MsgPack` wrapper and returns the wrapped item.
///
/// # Example
@ -133,7 +162,7 @@ impl<T> MsgPack<T> {
/// ```rust
/// # use rocket::serde::msgpack::MsgPack;
/// let string = "Hello".to_string();
/// let my_msgpack = MsgPack(string);
/// let my_msgpack: MsgPack<_> = MsgPack(string);
/// assert_eq!(my_msgpack.into_inner(), "Hello".to_string());
/// ```
#[inline(always)]
@ -186,9 +215,14 @@ impl<'r, T: Deserialize<'r>> FromData<'r> for MsgPack<T> {
/// Serializes the wrapped value into MessagePack. Returns a response with
/// Content-Type `MsgPack` and a fixed-size body with the serialization. If
/// serialization fails, an `Err` of `Status::InternalServerError` is returned.
impl<'r, T: Serialize> Responder<'r, 'static> for MsgPack<T> {
impl<'r, T: Serialize, const COMPACT: bool> Responder<'r, 'static> for MsgPack<T, COMPACT> {
fn respond_to(self, req: &'r Request<'_>) -> response::Result<'static> {
let buf = rmp_serde::to_vec(&self.0)
let maybe_buf = if COMPACT {
rmp_serde::to_vec(&self.0)
} else {
rmp_serde::to_vec_named(&self.0)
};
let buf = maybe_buf
.map_err(|e| {
error!("MsgPack serialize failure: {}", e);
Status::InternalServerError
@ -222,13 +256,13 @@ impl<'v, T: Deserialize<'v> + Send> form::FromFormField<'v> for MsgPack<T> {
// }
// }
impl<T> From<T> for MsgPack<T> {
impl<T, const COMPACT: bool> From<T> for MsgPack<T, COMPACT> {
fn from(value: T) -> Self {
MsgPack(value)
}
}
impl<T> Deref for MsgPack<T> {
impl<T, const COMPACT: bool> Deref for MsgPack<T, COMPACT> {
type Target = T;
#[inline(always)]
@ -237,7 +271,7 @@ impl<T> Deref for MsgPack<T> {
}
}
impl<T> DerefMut for MsgPack<T> {
impl<T, const COMPACT: bool> DerefMut for MsgPack<T, COMPACT> {
#[inline(always)]
fn deref_mut(&mut self) -> &mut T {
&mut self.0
@ -287,7 +321,8 @@ pub fn from_slice<'a, T>(v: &'a [u8]) -> Result<T, Error>
///
/// The compact representation represents structs as arrays.
///
/// **_Always_ use [`MsgPack`] to serialize MessagePack response data.**
/// **_Always_ use [`Compact`] to serialize MessagePack response data in a
/// compact format.**
///
/// # Example
///

View File

@ -58,11 +58,6 @@ impl<K: private::FmtKind> RocketFmt<K> {
}
}
pub fn reset(&mut self, cli_colors: CliColors, level: Option<Level>) {
let state = std::mem::take(&mut self.state);
*self = Self { state, ..Self::new(0, cli_colors, level) };
}
pub fn style(&self, metadata: &Metadata<'_>) -> Style {
match *metadata.level() {
Level::ERROR => self.style.red(),

View File

@ -1,17 +1,19 @@
use std::sync::OnceLock;
use tracing::{Dispatch, Event, Level, Metadata};
use tracing::{Dispatch, Event, Metadata};
use tracing::subscriber::{Subscriber, Interest};
use tracing::span::{Attributes, Id, Record};
use tracing_subscriber::reload;
use tracing_subscriber::registry::{Registry, LookupSpan};
use tracing_subscriber::layer::{Context, Layer, Layered, SubscriberExt};
use tracing_subscriber::reload;
use tracing_subscriber::util::SubscriberInitExt;
use crate::config::{Config, CliColors};
use crate::config::Config;
use crate::trace::subscriber::{Compact, Pretty, RequestId, RequestIdLayer, RocketFmt};
use crate::trace::TraceFormat;
/// A subscriber that is either a [`Pretty`] or [`Compact`] [`RocketFmt`].
pub struct RocketDynFmt {
inner: either::Either<RocketFmt<Compact>, RocketFmt<Pretty>>,
}
@ -29,7 +31,27 @@ impl From<RocketFmt<Pretty>> for RocketDynFmt {
}
impl RocketDynFmt {
pub fn init(config: Option<&Config>) {
/// Creates a new `RocketDynFmt` subscriber given a `Config`.
///
/// [`Config::log_format`] determines which `RocketFmt` subscriber (either
/// [`Pretty`] or [`Compact`]) is used.
///
/// If `config` is `None`, [`Config::debug_default()`] is used, which uses
/// the [`Pretty`] subscriber by default.
pub fn new(config: Option<&Config>) -> Self {
let default = Config::debug_default();
let workers = config.map_or(default.workers, |c| c.workers);
let colors = config.map_or(default.cli_colors, |c| c.cli_colors);
let level = config.map_or(default.log_level, |c| c.log_level);
let format = config.map_or(default.log_format, |c| c.log_format);
match format {
TraceFormat::Pretty => Self::from(RocketFmt::<Pretty>::new(workers, colors, level)),
TraceFormat::Compact => Self::from(RocketFmt::<Compact>::new(workers, colors, level)),
}
}
pub(crate) fn init(config: Option<&Config>) {
type Handle = reload::Handle<RocketDynFmt, Layered<RequestIdLayer, Registry>>;
static HANDLE: OnceLock<Handle> = OnceLock::new();
@ -39,17 +61,12 @@ impl RocketDynFmt {
return;
}
let workers = config.map_or(num_cpus::get(), |c| c.workers);
let colors = config.map_or(CliColors::Auto, |c| c.cli_colors);
let level = config.map_or(Some(Level::INFO), |c| c.log_level);
let format = config.map_or(TraceFormat::Pretty, |c| c.log_format);
let formatter = Self::new(config);
if let Some(handle) = HANDLE.get() {
return assert!(handle.modify(|layer| *layer = formatter).is_ok());
}
let formatter = |format| match format {
TraceFormat::Pretty => Self::from(RocketFmt::<Pretty>::new(workers, colors, level)),
TraceFormat::Compact => Self::from(RocketFmt::<Compact>::new(workers, colors, level)),
};
let (layer, reload_handle) = reload::Layer::new(formatter(format));
let (layer, reload_handle) = reload::Layer::new(formatter);
let result = tracing_subscriber::registry()
.with(RequestId::layer())
.with(layer)
@ -57,14 +74,8 @@ impl RocketDynFmt {
if result.is_ok() {
assert!(HANDLE.set(reload_handle).is_ok());
} else if let Some(handle) = HANDLE.get() {
assert!(handle.modify(|layer| *layer = formatter(format)).is_ok());
}
}
pub fn reset(&mut self, cli_colors: CliColors, level: Option<Level>) {
either::for_both!(&mut self.inner, f => f.reset(cli_colors, level))
}
}
macro_rules! forward {

View File

@ -0,0 +1,71 @@
#![cfg(feature = "msgpack")]
use std::borrow::Cow;
use rocket::{Rocket, Build};
use rocket::serde::msgpack::{self, MsgPack, Compact};
use rocket::local::blocking::Client;
#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)]
struct Person<'r> {
name: &'r str,
age: u8,
gender: Gender,
}
#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)]
enum Gender {
Male,
Female,
NonBinary,
}
#[rocket::post("/named", data = "<person>")]
fn named(person: MsgPack<Person<'_>>) -> MsgPack<Person<'_>> {
person
}
#[rocket::post("/compact", data = "<person>")]
fn compact(person: MsgPack<Person<'_>>) -> Compact<Person<'_>> {
MsgPack(person.into_inner())
}
fn rocket() -> Rocket<Build> {
rocket::build().mount("/", rocket::routes![named, compact])
}
// The object we're going to roundtrip through the API.
const OBJECT: Person<'static> = Person {
name: "Cal",
age: 17,
gender: Gender::NonBinary,
};
// [ "Cal", 17, "NonBinary" ]
const COMPACT_BYTES: &[u8] = &[
147, 163, 67, 97, 108, 17, 169, 78, 111, 110, 66, 105, 110, 97, 114, 121
];
// { "name": "Cal", "age": 17, "gender": "NonBinary" }
const NAMED_BYTES: &[u8] = &[
131, 164, 110, 97, 109, 101, 163, 67, 97, 108, 163, 97, 103, 101, 17, 166,
103, 101, 110, 100, 101, 114, 169, 78, 111, 110, 66, 105, 110, 97, 114, 121
];
#[test]
fn check_roundtrip() {
let client = Client::debug(rocket()).unwrap();
let inputs: &[(&'static str, Cow<'static, [u8]>)] = &[
("objpack", msgpack::to_vec(&OBJECT).unwrap().into()),
("named bytes", NAMED_BYTES.into()),
("compact bytes", COMPACT_BYTES.into()),
];
for (name, input) in inputs {
let compact = client.post("/compact").body(input).dispatch();
assert_eq!(compact.into_bytes().unwrap(), COMPACT_BYTES, "{name} mismatch");
let named = client.post("/named").body(input).dispatch();
assert_eq!(named.into_bytes().unwrap(), NAMED_BYTES, "{name} mismatch");
}
}

View File

@ -607,4 +607,4 @@ or `APP_` environment variables, Rocket will make use of them. The application
can also extract its configuration, done here via the `Adhoc::config()` fairing.
[`rocket::custom()`]: @api/master/rocket/fn.custom.html
[`rocket::build()`]: @api/master/rocket/fn.custom.html
[`rocket::build()`]: @api/master/rocket/fn.build.html

View File

@ -6,7 +6,7 @@
{
"name": "id",
"ordinal": 0,
"type_info": "Int64"
"type_info": "Integer"
},
{
"name": "title",

View File

@ -6,7 +6,7 @@
{
"name": "id",
"ordinal": 0,
"type_info": "Int64"
"type_info": "Integer"
}
],
"parameters": {

View File

@ -6,7 +6,7 @@
{
"name": "id",
"ordinal": 0,
"type_info": "Int64"
"type_info": "Integer"
}
],
"parameters": {

View File

@ -11,7 +11,7 @@ diesel = { version = "2", features = ["returning_clauses_for_sqlite_3_35"] }
diesel_migrations = "2"
[dependencies.sqlx]
version = "0.7.0"
version = "0.8.0"
default-features = false
features = ["macros", "migrate"]

View File

@ -14,7 +14,7 @@ This example implements a JSON-based HTTP API for a "blog" using several databas
* `sqlx` (`/sqlx`, `sqlx.rs`)
* `rusqlite` (`/rusqlite`, `rusqlite.rs`)
* `diesel` (sqlite) (`/diesel`, `diesel_sqlite.rs`)
* `diesel-async` (mysql) (`/diesel-async`, `diesel_mysql.rs`)
* `diesel-async` (mysql) (`/mysql`, `diesel_mysql.rs`)
The exposed API is succinctly described as follows, with
[`httpie`](https://httpie.io/) CLI examples:

View File

@ -1,9 +1,10 @@
use rocket::{Rocket, Build};
use rocket::fairing::AdHoc;
use rocket::response::{Debug, status::Created};
use rocket::serde::{Serialize, Deserialize, json::Json};
use rocket_db_pools::{Database, Connection};
use rocket_db_pools::diesel::{MysqlPool, prelude::*};
use rocket_db_pools::diesel::{prelude::*, MysqlPool};
type Result<T, E = Debug<diesel::result::Error>> = std::result::Result<T, E>;
@ -34,7 +35,7 @@ diesel::table! {
#[post("/", data = "<post>")]
async fn create(mut db: Connection<Db>, mut post: Json<Post>) -> Result<Created<Json<Post>>> {
diesel::sql_function!(fn last_insert_id() -> BigInt);
diesel::define_sql_function!(fn last_insert_id() -> BigInt);
let post = db.transaction(|mut conn| Box::pin(async move {
diesel::insert_into(posts::table)
@ -89,9 +90,33 @@ async fn destroy(mut db: Connection<Db>) -> Result<()> {
Ok(())
}
async fn run_migrations(rocket: Rocket<Build>) -> Rocket<Build> {
use rocket_db_pools::diesel::AsyncConnectionWrapper;
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
const MIGRATIONS: EmbeddedMigrations = embed_migrations!("db/diesel/mysql-migrations");
let conn = Db::fetch(&rocket)
.expect("database is attached")
.get().await
.unwrap_or_else(|e| {
span_error!("failed to connect to MySQL database" => error!("{e}"));
panic!("aborting launch");
});
// `run_pending_migrations` blocks, so it must be run in `spawn_blocking`
rocket::tokio::task::spawn_blocking(move || {
let mut conn: AsyncConnectionWrapper<_> = conn.into();
conn.run_pending_migrations(MIGRATIONS).expect("diesel migrations");
}).await.expect("diesel migrations");
rocket
}
pub fn stage() -> AdHoc {
AdHoc::on_ignite("Diesel MySQL Stage", |rocket| async {
rocket.attach(Db::init())
.mount("/diesel-async", routes![list, read, create, delete, destroy])
.attach(AdHoc::on_ignite("Diesel Migrations", run_migrations))
.mount("/mysql", routes![list, read, create, delete, destroy])
})
}

View File

@ -5,6 +5,9 @@
# directly for your browser to show connections as secure. You should NEVER use
# these certificate/key pairs. They are here for DEMONSTRATION PURPOSES ONLY.
[default]
log_format = "compact"
[default.tls]
certs = "private/rsa_sha256_cert.pem"
key = "private/rsa_sha256_key.pem"

View File

@ -3,7 +3,7 @@
use std::net::SocketAddr;
use rocket::http::Status;
use rocket::tracing::Level;
use rocket::tracing::{self, Instrument};
use rocket::{route, Error, Request, Data, Route, Orbit, Rocket, Ignite};
use rocket::fairing::{Fairing, Info, Kind};
use rocket::response::Redirect;
@ -45,16 +45,13 @@ impl Redirector {
pub async fn try_launch(self, config: Config) -> Result<Rocket<Ignite>, Error> {
use rocket::http::Method::*;
rocket::span_info!("HTTP -> HTTPS Redirector" => {
info!(from = self.0, to = config.tls_addr.port(), "redirecting");
});
// Build a vector of routes to `redirect` on `<path..>` for each method.
let redirects = [Get, Put, Post, Delete, Options, Head, Trace, Connect, Patch]
.into_iter()
.map(|m| Route::new(m, "/<path..>", Self::redirect))
.collect::<Vec<_>>();
info!(from = self.0, to = config.tls_addr.port(), "redirecting");
let addr = SocketAddr::new(config.tls_addr.ip(), self.0);
rocket::custom(&config.server)
.manage(config)
@ -73,35 +70,25 @@ impl Fairing for Redirector {
}
}
#[tracing::instrument(name = "HTTP -> HTTPS Redirector", skip_all)]
async fn on_liftoff(&self, rocket: &Rocket<Orbit>) {
let Some(tls_addr) = rocket.endpoints().find_map(|e| e.tls()?.tcp()) else {
rocket::span_warn!("HTTP -> HTTPS Redirector" => {
warn!("Main instance is not being served over TLS/TCP.\n\
Redirector refusing to start.");
});
warn!("Main instance is not being served over TLS/TCP.\n\
Redirector refusing to start.");
return;
};
let config = Config {
tls_addr,
server: rocket::Config {
log_level: Some(Level::ERROR),
..rocket.config().clone()
},
};
let this = *self;
let shutdown = rocket.shutdown();
let span = tracing::info_span!("HTTP -> HTTPS Redirector");
let config = Config { tls_addr, server: rocket.config().clone() };
rocket::tokio::spawn(async move {
if let Err(e) = this.try_launch(config).await {
span_error!("HTTP -> HTTPS Redirector", "failed to start" => {
e.trace_error();
info!("shutting down main instance");
});
e.trace_error();
info!("shutting down main instance");
shutdown.notify();
}
});
}.instrument(span));
}
}

View File

@ -200,14 +200,42 @@ function run_testbench() {
indir "${TESTBENCH_ROOT}" $CARGO run $@
}
# The kind of test we'll be running.
TEST_KIND="default"
KINDS=("default" "all" "core" "contrib" "examples" "benchmarks" "testbench" "ui")
function print_help() {
echo "USAGE:"
echo " $0 [+<TOOLCHAIN>] [--help|-h] [--<TEST>]"
echo ""
echo "OPTIONS:"
echo " +<TOOLCHAIN> Forwarded to Cargo to select toolchain."
echo " --help, -h Print this help message and exit."
echo " --<TEST> Run the specified test suite."
echo " (Run without --<TEST> to run default tests.)"
echo ""
echo "AVAILABLE <TEST> OPTIONS:"
for kind in "${KINDS[@]}"; do
echo " ${kind}"
done
echo ""
echo "EXAMPLES:"
echo " $0 # Run default tests on current toolchain."
echo " $0 +stable --all # Run all tests on stable toolchain."
echo " $0 --ui # Run UI tests on current toolchain."
}
if [[ $1 == +* ]]; then
CARGO="$CARGO $1"
shift
fi
# The kind of test we'll be running.
TEST_KIND="default"
KINDS=("contrib" "benchmarks" "testbench" "core" "examples" "default" "ui" "all")
if [[ $1 == "--help" ]] || [[ $1 == "-h" ]]; then
print_help
exit 0
fi
if [[ " ${KINDS[@]} " =~ " ${1#"--"} " ]]; then
TEST_KIND=${1#"--"}

View File

@ -26,7 +26,9 @@ impl Client {
.connect_timeout(Duration::from_secs(5))
}
pub fn request(&self, server: &Server, method: Method, url: &str) -> Result<RequestBuilder> {
pub fn request<M>(&self, server: &Server, method: M, url: &str) -> Result<RequestBuilder>
where M: AsRef<str>
{
let uri = match Uri::parse_any(url).map_err(|e| e.into_owned())? {
Uri::Origin(uri) => {
let proto = if server.tls { "https" } else { "http" };
@ -45,7 +47,7 @@ impl Client {
uri => return Err(Error::InvalidUri(uri.into_owned())),
};
let method = reqwest::Method::from_str(method.as_str()).unwrap();
let method = reqwest::Method::from_str(method.as_ref()).unwrap();
Ok(self.client.request(method, uri.to_string()))
}

View File

@ -0,0 +1,29 @@
//! Test that HTTP method extensions unlike POST or GET work.
use crate::prelude::*;
use rocket::http::Method;
#[route(PROPFIND, uri = "/")]
fn route() -> &'static str {
"Hello, World!"
}
pub fn test_http_extensions() -> Result<()> {
let server = spawn! {
Rocket::default().mount("/", routes![route])
}?;
let client = Client::default();
let response = client.request(&server, Method::PropFind, "/")?.send()?;
assert_eq!(response.status(), 200);
assert_eq!(response.text()?, "Hello, World!");
// Make sure that verbs outside of extensions are marked as errors
let res = client.request(&server, "BAKEMEACOOKIE", "/")?.send()?;
assert_eq!(res.status(), 400);
Ok(())
}
register!(test_http_extensions);

View File

@ -1,5 +1,6 @@
pub mod ignite_failure;
pub mod bind;
pub mod http_extensions;
pub mod infinite_stream;
pub mod tls_resolver;
pub mod mtls;